tf.complex()

tf.complex(real, imag, name=None) Converts two real numbers to a complex number. Given a tensor real representing the real part of a complex number, and a tensor imag representing the imaginary part of a complex number, this operation returns complex numbers elementwise of the form (a + bj), where a represents the real part and b represents the imag part. The input tensors real and imag must have the same shape. For example: # tensor 'real' is [2.25, 3.25] # tensor `imag` is [4.75, 5.75] tf.co

tf.map_fn()

tf.map_fn(fn, elems, dtype=None, parallel_iterations=10, back_prop=True, swap_memory=False, infer_shape=True, name=None) map on the list of tensors unpacked from elems on dimension 0. The simplest version of map repeatedly applies the callable fn to a sequence of elements from first to last. The elements are made of the tensors unpacked from elems. dtype is the data type of the return value of fn. Users must provide dtype if it is different from the data type of elems. Suppose that elems is un

tf.contrib.distributions.MultivariateNormalDiagPlusVDVT.batch_shape()

tf.contrib.distributions.MultivariateNormalDiagPlusVDVT.batch_shape(name='batch_shape') Shape of a single sample from a single event index as a 1-D Tensor. The product of the dimensions of the batch_shape is the number of independent distributions of this kind the instance represents. Args: name: name to give to the op Returns: batch_shape: Tensor.

tf.contrib.distributions.DirichletMultinomial.event_shape()

tf.contrib.distributions.DirichletMultinomial.event_shape(name='event_shape') Shape of a single sample from a single batch as a 1-D int32 Tensor. Args: name: name to give to the op Returns: event_shape: Tensor.

tf.assert_less_equal()

tf.assert_less_equal(x, y, data=None, summarize=None, message=None, name=None) Assert the condition x <= y holds element-wise. Example of adding a dependency to an operation: with tf.control_dependencies([tf.assert_less_equal(x, y)]): output = tf.reduce_sum(x) Example of adding dependency to the tensor being checked: x = tf.with_dependencies([tf.assert_less_equal(x, y)], x) This condition holds if for every pair of (possibly broadcast) elements x[i], y[i], we have x[i] <= y[i]. If bo

tf.contrib.losses.cosine_distance()

tf.contrib.losses.cosine_distance(predictions, targets, dim, weight=1.0, scope=None) Adds a cosine-distance loss to the training procedure. Note that the function assumes that the predictions and targets are already unit-normalized. Args: predictions: An arbitrary matrix. targets: A Tensor whose shape matches 'predictions' dim: The dimension along which the cosine distance is computed. weight: Coefficients for the loss a scalar, a tensor of shape [batch_size] or a tensor whose shape matche

tf.contrib.bayesflow.stochastic_tensor.SampleAndReshapeValue

class tf.contrib.bayesflow.stochastic_tensor.SampleAndReshapeValue Ask the StochasticTensor for n samples and reshape the result. Sampling from a StochasticTensor increases the rank of the value by 1 (because each sample represents a new outer dimension). This ValueType requests n samples from StochasticTensors run within its context that the outer two dimensions are reshaped to intermix the samples with the outermost (usually batch) dimension. Example: # mu and sigma are both shaped (2, 3) mu

tf.nn.rnn_cell.BasicLSTMCell.__call__()

tf.nn.rnn_cell.BasicLSTMCell.__call__(inputs, state, scope=None) Long short-term memory cell (LSTM).

tf.contrib.distributions.Binomial.prob()

tf.contrib.distributions.Binomial.prob(value, name='prob') Probability density/mass function (depending on is_continuous). Additional documentation from Binomial: For each batch member of counts value, P[counts] is the probability that after sampling n draws from this Binomial distribution, the number of successes is k. Note that different sequences of draws can result in the same counts, thus the probability includes a combinatorial coefficient. value must be a non-negative tensor with dtype

tf.add_n()

tf.add_n(inputs, name=None) Adds all input tensors element-wise. Args: inputs: A list of Tensor objects, each with same shape and type. name: A name for the operation (optional). Returns: A Tensor of same shape and type as the elements of inputs. Raises: ValueError: If inputs don't all have same shape and dtype or the shape cannot be inferred.