of type complex64
. A complex64 tensor.
name: A name for the operation (optional).
Returns:
A Tensor
of type complex64
.
A complex64 tensor of the same shape as input
. The inner-most
dimension of input
is replaced with its 1D Fourier Transform.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def fft2d(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.fft2d, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.fft2d
Return
Applicative
Origial documentation for Builder.fft2d
def fft2d(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.fft2d
to work with tensorbuilder.core.builders.Builder
s. Instead of taking a Tensor as its first argument it takes a builder, the rest of the arguments are exactly the same.
Original Documentation for tf.fft2d
def fft2d(input, name=None)
Compute the 2-dimensional discrete Fourier Transform over the inner-most
2 dimensions of input
.
Args:
input: A Tensor
of type complex64
. A complex64 tensor.
name: A name for the operation (optional).
Returns:
A Tensor
of type complex64
.
A complex64 tensor of the same shape as input
. The inner-most 2
dimensions of input
are replaced with their 2D Fourier Transform.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def fft2d_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.fft2d_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.fft2d_layer
Return
Applicative
Origial documentation for Builder.fft2d_layer
def fft2d_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.fft2d, ...)
Arguments
size
: the size of the resulting layer- All other *args and **kwargs are forwarded to
tf.contrib.layers.fully_connected
Return
Builder
Origial documentation for tf.fft2d
def fft2d(input, name=None):
Compute the 2-dimensional discrete Fourier Transform over the inner-most
2 dimensions of input
.
Args:
input: A Tensor
of type complex64
. A complex64 tensor.
name: A name for the operation (optional).
Returns:
A Tensor
of type complex64
.
A complex64 tensor of the same shape as input
. The inner-most 2
dimensions of input
are replaced with their 2D Fourier Transform.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def fft3d(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.fft3d, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.fft3d
Return
Applicative
Origial documentation for Builder.fft3d
def fft3d(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.fft3d
to work with tensorbuilder.core.builders.Builder
s. Instead of taking a Tensor as its first argument it takes a builder, the rest of the arguments are exactly the same.
Original Documentation for tf.fft3d
def fft3d(input, name=None)
Compute the 3-dimensional discrete Fourier Transform over the inner-most 3
dimensions of input
.
Args:
input: A Tensor
of type complex64
. A complex64 tensor.
name: A name for the operation (optional).
Returns:
A Tensor
of type complex64
.
A complex64 tensor of the same shape as input
. The inner-most 3
dimensions of input
are replaced with their 3D Fourier Transform.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def fft3d_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.fft3d_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.fft3d_layer
Return
Applicative
Origial documentation for Builder.fft3d_layer
def fft3d_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.fft3d, ...)
Arguments
size
: the size of the resulting layer- All other *args and **kwargs are forwarded to
tf.contrib.layers.fully_connected
Return
Builder
Origial documentation for tf.fft3d
def fft3d(input, name=None):
Compute the 3-dimensional discrete Fourier Transform over the inner-most 3
dimensions of input
.
Args:
input: A Tensor
of type complex64
. A complex64 tensor.
name: A name for the operation (optional).
Returns:
A Tensor
of type complex64
.
A complex64 tensor of the same shape as input
. The inner-most 3
dimensions of input
are replaced with their 3D Fourier Transform.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def fft_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.fft_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.fft_layer
Return
Applicative
Origial documentation for Builder.fft_layer
def fft_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.fft, ...)
Arguments
size
: the size of the resulting layer- All other *args and **kwargs are forwarded to
tf.contrib.layers.fully_connected
Return
Builder
Origial documentation for tf.fft
def fft(input, name=None):
Compute the 1-dimensional discrete Fourier Transform over the inner-most
dimension of input
.
Args:
input: A Tensor
of type complex64
. A complex64 tensor.
name: A name for the operation (optional).
Returns:
A Tensor
of type complex64
.
A complex64 tensor of the same shape as input
. The inner-most
dimension of input
is replaced with its 1D Fourier Transform.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def fill(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.fill, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.fill
Return
Applicative
Origial documentation for Builder.fill
def fill(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.fill
to work with tensorbuilder.core.builders.Builder
s. Instead of taking a Tensor as its first argument it takes a builder, the rest of the arguments are exactly the same.
Original Documentation for tf.fill
def fill(dims, value, name=None)
Creates a tensor filled with a scalar value.
This operation creates a tensor of shape dims
and fills it with value
.
For example:
```prettyprint
Output tensor has shape [2, 3].
fill([2, 3], 9) ==> [[9, 9, 9] [9, 9, 9]] ```
Args:
dims: A Tensor
of type int32
.
1-D. Represents the shape of the output tensor.
value: A Tensor
. 0-D (scalar). Value to fill the returned tensor.
name: A name for the operation (optional).
Returns:
A Tensor
. Has the same type as value
.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def fill_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.fill_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.fill_layer
Return
Applicative
Origial documentation for Builder.fill_layer
def fill_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.fill, ...)
Arguments
size
: the size of the resulting layer- All other *args and **kwargs are forwarded to
tf.contrib.layers.fully_connected
Return
Builder
Origial documentation for tf.fill
def fill(dims, value, name=None):
Creates a tensor filled with a scalar value.
This operation creates a tensor of shape dims
and fills it with value
.
For example:
```prettyprint
Output tensor has shape [2, 3].
fill([2, 3], 9) ==> [[9, 9, 9] [9, 9, 9]] ```
Args:
dims: A Tensor
of type int32
.
1-D. Represents the shape of the output tensor.
value: A Tensor
. 0-D (scalar). Value to fill the returned tensor.
name: A name for the operation (optional).
Returns:
A Tensor
. Has the same type as value
.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def fixed_size_partitioner(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.fixed_size_partitioner, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.fixed_size_partitioner
Return
Applicative
Origial documentation for Builder.fixed_size_partitioner
def fixed_size_partitioner(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.fixed_size_partitioner
to work with tensorbuilder.core.builders.Builder
s. Instead of taking a Tensor as its first argument it takes a builder, the rest of the arguments are exactly the same.
Original Documentation for tf.fixed_size_partitioner
def fixed_size_partitioner(num_shards, axis=0)
Partitioner to specify a fixed number of shards along given axis.
Args:
num_shards: int
, number of shards to partition variable.
axis: int
, axis to partition on.
Returns:
A partition function usable as the partitioner
argument to
variable_scope
, get_variable
, and get_partitioned_variable_list
.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def fixed_size_partitioner_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.fixed_size_partitioner_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.fixed_size_partitioner_layer
Return
Applicative
Origial documentation for Builder.fixed_size_partitioner_layer
def fixed_size_partitioner_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.fixed_size_partitioner, ...)
Arguments
size
: the size of the resulting layer- All other *args and **kwargs are forwarded to
tf.contrib.layers.fully_connected
Return
Builder
Origial documentation for tf.fixed_size_partitioner
def fixed_size_partitioner(num_shards, axis=0):
Partitioner to specify a fixed number of shards along given axis.
Args:
num_shards: int
, number of shards to partition variable.
axis: int
, axis to partition on.
Returns:
A partition function usable as the partitioner
argument to
variable_scope
, get_variable
, and get_partitioned_variable_list
.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def fixed_unigram_candidate_sampler(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.fixed_unigram_candidate_sampler, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.fixed_unigram_candidate_sampler
Return
Applicative
Origial documentation for Builder.fixed_unigram_candidate_sampler
def fixed_unigram_candidate_sampler(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.nn.fixed_unigram_candidate_sampler
to work with tensorbuilder.core.builders.Builder
s. Instead of taking a Tensor as its first argument it takes a builder, the rest of the arguments are exactly the same.
Original Documentation for tf.nn.fixed_unigram_candidate_sampler
def fixed_unigram_candidate_sampler(true_classes, num_true, num_sampled, unique, range_max, vocab_file="", distortion=1.0, num_reserved_ids=0, num_shards=1, shard=0, unigrams=(), seed=None, name=None)
Samples a set of classes using the provided (fixed) base distribution.
This operation randomly samples a tensor of sampled classes
(sampled_candidates
) from the range of integers [0, range_max)
.
The elements of sampled_candidates
are drawn without replacement
(if unique=True
) or with replacement (if unique=False
) from
the base distribution.
The base distribution is read from a file or passed in as an in-memory array. There is also an option to skew the distribution by applying a distortion power to the weights.
In addition, this operation returns tensors true_expected_count
and sampled_expected_count
representing the number of times each
of the target classes (true_classes
) and the sampled
classes (sampled_candidates
) is expected to occur in an average
tensor of sampled classes. These values correspond to Q(y|x)
defined in this
document.
If unique=True
, then these are post-rejection probabilities and we
compute them approximately.
Args:
true_classes: A Tensor
of type int64
and shape [batch_size,
num_true]
. The target classes.
num_true: An int
. The number of target classes per training example.
num_sampled: An int
. The number of classes to randomly sample per batch.
unique: A bool
. Determines whether all sampled classes in a batch are
unique.
range_max: An int
. The number of possible classes.
vocab_file: Each valid line in this file (which should have a CSV-like
format) corresponds to a valid word ID. IDs are in sequential order,
starting from num_reserved_ids. The last entry in each line is expected
to be a value corresponding to the count or relative probability. Exactly
one of vocab_file
and unigrams
needs to be passed to this operation.
distortion: The distortion is used to skew the unigram probability
distribution. Each weight is first raised to the distortion's power
before adding to the internal unigram distribution. As a result,
distortion = 1.0
gives regular unigram sampling (as defined by the vocab
file), and distortion = 0.0
gives a uniform distribution.
num_reserved_ids: Optionally some reserved IDs can be added in the range
[0, num_reserved_ids]
by the users. One use case is that a special
unknown word token is used as ID 0. These IDs will have a sampling
probability of 0.
num_shards: A sampler can be used to sample from a subset of the original
range in order to speed up the whole computation through parallelism. This
parameter (together with shard
) indicates the number of partitions that
are being used in the overall computation.
shard: A sampler can be used to sample from a subset of the original range
in order to speed up the whole computation through parallelism. This
parameter (together with num_shards
) indicates the particular partition
number of the operation, when partitioning is being used.
unigrams: A list of unigram counts or probabilities, one per ID in
sequential order. Exactly one of vocab_file
and unigrams
should be
passed to this operation.
seed: An int
. An operation-specific seed. Default is 0.
name: A name for the operation (optional).
Returns:
sampled_candidates: A tensor of type int64
and shape [num_sampled]
.
The sampled classes.
true_expected_count: A tensor of type float
. Same shape as
true_classes
. The expected counts under the sampling distribution
of each of true_classes
.
sampled_expected_count: A tensor of type float
. Same shape as
sampled_candidates
. The expected counts under the sampling distribution
of each of sampled_candidates
.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def fixed_unigram_candidate_sampler_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.fixed_unigram_candidate_sampler_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.fixed_unigram_candidate_sampler_layer
Return
Applicative
Origial documentation for Builder.fixed_unigram_candidate_sampler_layer
def fixed_unigram_candidate_sampler_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.nn.fixed_unigram_candidate_sampler, ...)
Arguments
size
: the size of the resulting layer- All other *args and **kwargs are forwarded to
tf.contrib.layers.fully_connected
Return
Builder
Origial documentation for tf.nn.fixed_unigram_candidate_sampler
def fixed_unigram_candidate_sampler(true_classes, num_true, num_sampled, unique, range_max, vocab_file="", distortion=1.0, num_reserved_ids=0, num_shards=1, shard=0, unigrams=(), seed=None, name=None):
Samples a set of classes using the provided (fixed) base distribution.
This operation randomly samples a tensor of sampled classes
(sampled_candidates
) from the range of integers [0, range_max)
.
The elements of sampled_candidates
are drawn without replacement
(if unique=True
) or with replacement (if unique=False
) from
the base distribution.
The base distribution is read from a file or passed in as an in-memory array. There is also an option to skew the distribution by applying a distortion power to the weights.
In addition, this operation returns tensors true_expected_count
and sampled_expected_count
representing the number of times each
of the target classes (true_classes
) and the sampled
classes (sampled_candidates
) is expected to occur in an average
tensor of sampled classes. These values correspond to Q(y|x)
defined in this
document.
If unique=True
, then these are post-rejection probabilities and we
compute them approximately.
Args:
true_classes: A Tensor
of type int64
and shape [batch_size,
num_true]
. The target classes.
num_true: An int
. The number of target classes per training example.
num_sampled: An int
. The number of classes to randomly sample per batch.
unique: A bool
. Determines whether all sampled classes in a batch are
unique.
range_max: An int
. The number of possible classes.
vocab_file: Each valid line in this file (which should have a CSV-like
format) corresponds to a valid word ID. IDs are in sequential order,
starting from num_reserved_ids. The last entry in each line is expected
to be a value corresponding to the count or relative probability. Exactly
one of vocab_file
and unigrams
needs to be passed to this operation.
distortion: The distortion is used to skew the unigram probability
distribution. Each weight is first raised to the distortion's power
before adding to the internal unigram distribution. As a result,
distortion = 1.0
gives regular unigram sampling (as defined by the vocab
file), and distortion = 0.0
gives a uniform distribution.
num_reserved_ids: Optionally some reserved IDs can be added in the range
[0, num_reserved_ids]
by the users. One use case is that a special
unknown word token is used as ID 0. These IDs will have a sampling
probability of 0.
num_shards: A sampler can be used to sample from a subset of the original
range in order to speed up the whole computation through parallelism. This
parameter (together with shard
) indicates the number of partitions that
are being used in the overall computation.
shard: A sampler can be used to sample from a subset of the original range
in order to speed up the whole computation through parallelism. This
parameter (together with num_shards
) indicates the particular partition
number of the operation, when partitioning is being used.
unigrams: A list of unigram counts or probabilities, one per ID in
sequential order. Exactly one of vocab_file
and unigrams
should be
passed to this operation.
seed: An int
. An operation-specific seed. Default is 0.
name: A name for the operation (optional).
Returns:
sampled_candidates: A tensor of type int64
and shape [num_sampled]
.
The sampled classes.
true_expected_count: A tensor of type float
. Same shape as
true_classes
. The expected counts under the sampling distribution
of each of true_classes
.
sampled_expected_count: A tensor of type float
. Same shape as
sampled_candidates
. The expected counts under the sampling distribution
of each of sampled_candidates
.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def flatten(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.flatten, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.flatten
Return
Applicative
Origial documentation for Builder.flatten
def flatten(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.contrib.layers.flatten
to work with tensorbuilder.core.builders.Builder
s. Instead of taking a Tensor as its first argument it takes a builder, the rest of the arguments are exactly the same.
Original Documentation for tf.contrib.layers.flatten
def flatten()
Flattens the input while maintaining the batch_size.
Assumes that the first dimension represents the batch.
Args: inputs: a tensor of size [batch_size, ...]. outputs_collections: collection to add the outputs. scope: Optional scope for name_scope.
Returns: a flattened tensor with shape [batch_size, k]. Raises: ValueError: if inputs.shape is wrong.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def floor(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.floor, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.floor
Return
Applicative
Origial documentation for Builder.floor
def floor(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.floor
to work with tensorbuilder.core.builders.Builder
s. Instead of taking a Tensor as its first argument it takes a builder, the rest of the arguments are exactly the same.
Original Documentation for tf.floor
def floor(x, name=None)
Returns element-wise largest integer not greater than x.
Args:
x: A Tensor
. Must be one of the following types: half
, float32
, float64
.
name: A name for the operation (optional).
Returns:
A Tensor
. Has the same type as x
.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def floor_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.floor_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.floor_layer
Return
Applicative
Origial documentation for Builder.floor_layer
def floor_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.floor, ...)
Arguments
size
: the size of the resulting layer- All other *args and **kwargs are forwarded to
tf.contrib.layers.fully_connected
Return
Builder
Origial documentation for tf.floor
def floor(x, name=None):
Returns element-wise largest integer not greater than x.
Args:
x: A Tensor
. Must be one of the following types: half
, float32
, float64
.
name: A name for the operation (optional).
Returns:
A Tensor
. Has the same type as x
.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def floordiv(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.floordiv, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.floordiv
Return
Applicative
Origial documentation for Builder.floordiv
def floordiv(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.floordiv
to work with tensorbuilder.core.builders.Builder
s. Instead of taking a Tensor as its first argument it takes a builder, the rest of the arguments are exactly the same.
Original Documentation for tf.floordiv
def floordiv(x, y, name=None)
Divides x / y
elementwise, rounding down for floating point.
The same as tf.div(x,y)
for integers, but uses tf.floor(tf.div(x,y))
for
floating point arguments so that the result is always an integer (though
possibly an integer represented as floating point). This op is generated by
x // y
floor division in Python 3 and in Python 2.7 with
from __future__ import division
.
Note that for efficiency, floordiv
uses C semantics for negative numbers
(unlike Python and Numpy).
x
and y
must have the same type, and the result will have the same type
as well.
Args:
x: Tensor
numerator of real numeric type.
y: Tensor
denominator of real numeric type.
name: A name for the operation (optional).
Returns:
x / y
rounded down (except possibly towards zero for negative integers).
Raises: TypeError: If the inputs are complex.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def floordiv_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.floordiv_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.floordiv_layer
Return
Applicative
Origial documentation for Builder.floordiv_layer
def floordiv_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.floordiv, ...)
Arguments
size
: the size of the resulting layer- All other *args and **kwargs are forwarded to
tf.contrib.layers.fully_connected
Return
Builder
Origial documentation for tf.floordiv
def floordiv(x, y, name=None):
Divides x / y
elementwise, rounding down for floating point.
The same as tf.div(x,y)
for integers, but uses tf.floor(tf.div(x,y))
for
floating point arguments so that the result is always an integer (though
possibly an integer represented as floating point). This op is generated by
x // y
floor division in Python 3 and in Python 2.7 with
from __future__ import division
.
Note that for efficiency, floordiv
uses C semantics for negative numbers
(unlike Python and Numpy).
x
and y
must have the same type, and the result will have the same type
as well.
Args:
x: Tensor
numerator of real numeric type.
y: Tensor
denominator of real numeric type.
name: A name for the operation (optional).
Returns:
x / y
rounded down (except possibly towards zero for negative integers).
Raises: TypeError: If the inputs are complex.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def foldl(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.foldl, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.foldl
Return
Applicative
Origial documentation for Builder.foldl
def foldl(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.foldl
to work with tensorbuilder.core.builders.Builder
s. Instead of taking a Tensor as its first argument it takes a builder, the rest of the arguments are exactly the same.
Original Documentation for tf.foldl
def foldl(fn, elems, initializer=None, parallel_iterations=10, back_prop=True, swap_memory=False, name=None)
foldl on the list of tensors unpacked from elems
on dimension 0.
This foldl operator repeatedly applies the callable fn
to a sequence
of elements from first to last. The elements are made of the tensors
unpacked from elems
on dimension 0. The callable fn takes two tensors as
arguments. The first argument is the accumulated value computed from the
preceding invocation of fn. If initializer
is None, elems
must contain
at least one element, and its first element is used as the initializer.
Suppose that elems
is unpacked into values
, a list of tensors. The shape
of the result tensor is fn(initializer, values[0]).shape`.
Args: fn: The callable to be performed. elems: A tensor to be unpacked on dimension 0. initializer: (optional) The initial value for the accumulator. parallel_iterations: (optional) The number of iterations allowed to run in parallel. back_prop: (optional) True enables support for back propagation. swap_memory: (optional) True enables GPU-CPU memory swapping. name: (optional) Name prefix for the returned tensors.
Returns:
A tensor resulting from applying fn
consecutively to the list of tensors
unpacked from elems
, from first to last.
Raises:
TypeError: if fn
is not callable.
Example:
python
elems = [1, 2, 3, 4, 5, 6]
sum = foldl(lambda a, x: a + x, elems)
# sum == 21
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def foldl_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.foldl_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.foldl_layer
Return
Applicative
Origial documentation for Builder.foldl_layer
def foldl_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.foldl, ...)
Arguments
size
: the size of the resulting layer- All other *args and **kwargs are forwarded to
tf.contrib.layers.fully_connected
Return
Builder
Origial documentation for tf.foldl
def foldl(fn, elems, initializer=None, parallel_iterations=10, back_prop=True, swap_memory=False, name=None):
foldl on the list of tensors unpacked from elems
on dimension 0.
This foldl operator repeatedly applies the callable fn
to a sequence
of elements from first to last. The elements are made of the tensors
unpacked from elems
on dimension 0. The callable fn takes two tensors as
arguments. The first argument is the accumulated value computed from the
preceding invocation of fn. If initializer
is None, elems
must contain
at least one element, and its first element is used as the initializer.
Suppose that elems
is unpacked into values
, a list of tensors. The shape
of the result tensor is fn(initializer, values[0]).shape`.
Args: fn: The callable to be performed. elems: A tensor to be unpacked on dimension 0. initializer: (optional) The initial value for the accumulator. parallel_iterations: (optional) The number of iterations allowed to run in parallel. back_prop: (optional) True enables support for back propagation. swap_memory: (optional) True enables GPU-CPU memory swapping. name: (optional) Name prefix for the returned tensors.
Returns:
A tensor resulting from applying fn
consecutively to the list of tensors
unpacked from elems
, from first to last.
Raises:
TypeError: if fn
is not callable.
Example:
python
elems = [1, 2, 3, 4, 5, 6]
sum = foldl(lambda a, x: a + x, elems)
# sum == 21
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def foldr(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.foldr, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.foldr
Return
Applicative
Origial documentation for Builder.foldr
def foldr(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.foldr
to work with tensorbuilder.core.builders.Builder
s. Instead of taking a Tensor as its first argument it takes a builder, the rest of the arguments are exactly the same.
Original Documentation for tf.foldr
def foldr(fn, elems, initializer=None, parallel_iterations=10, back_prop=True, swap_memory=False, name=None)
foldr on the list of tensors unpacked from elems
on dimension 0.
This foldr operator repeatedly applies the callable fn
to a sequence
of elements from last to first. The elements are made of the tensors
unpacked from elems
. The callable fn takes two tensors as arguments.
The first argument is the accumulated value computed from the preceding
invocation of fn. If initializer
is None, elems
must contain at least
one element, and its first element is used as the initializer.
Suppose that elems
is unpacked into values
, a list of tensors. The shape
of the result tensor is fn(initializer, values[0]).shape
.
Args:
fn: The callable to be performed.
elems: A tensor that is unpacked into a sequence of tensors to apply fn
.
initializer: (optional) The initial value for the accumulator.
parallel_iterations: (optional) The number of iterations allowed to run
in parallel.
back_prop: (optional) True enables support for back propagation.
swap_memory: (optional) True enables GPU-CPU memory swapping.
name: (optional) Name prefix for the returned tensors.
Returns:
A tensor resulting from applying fn
consecutively to the list of tensors
unpacked from elems
, from last to first.
Raises:
TypeError: if fn
is not callable.
Example:
python
elems = [1, 2, 3, 4, 5, 6]
sum = foldr(lambda a, x: a + x, elems)
# sum == 21
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def foldr_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.foldr_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.foldr_layer
Return
Applicative
Origial documentation for Builder.foldr_layer
def foldr_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.foldr, ...)
Arguments
size
: the size of the resulting layer- All other *args and **kwargs are forwarded to
tf.contrib.layers.fully_connected
Return
Builder
Origial documentation for tf.foldr
def foldr(fn, elems, initializer=None, parallel_iterations=10, back_prop=True, swap_memory=False, name=None):
foldr on the list of tensors unpacked from elems
on dimension 0.
This foldr operator repeatedly applies the callable fn
to a sequence
of elements from last to first. The elements are made of the tensors
unpacked from elems
. The callable fn takes two tensors as arguments.
The first argument is the accumulated value computed from the preceding
invocation of fn. If initializer
is None, elems
must contain at least
one element, and its first element is used as the initializer.
Suppose that elems
is unpacked into values
, a list of tensors. The shape
of the result tensor is fn(initializer, values[0]).shape
.
Args:
fn: The callable to be performed.
elems: A tensor that is unpacked into a sequence of tensors to apply fn
.
initializer: (optional) The initial value for the accumulator.
parallel_iterations: (optional) The number of iterations allowed to run
in parallel.
back_prop: (optional) True enables support for back propagation.
swap_memory: (optional) True enables GPU-CPU memory swapping.
name: (optional) Name prefix for the returned tensors.
Returns:
A tensor resulting from applying fn
consecutively to the list of tensors
unpacked from elems
, from last to first.
Raises:
TypeError: if fn
is not callable.
Example:
python
elems = [1, 2, 3, 4, 5, 6]
sum = foldr(lambda a, x: a + x, elems)
# sum == 21
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def fractional_avg_pool(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.fractional_avg_pool, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.fractional_avg_pool
Return
Applicative
Origial documentation for Builder.fractional_avg_pool
def fractional_avg_pool(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.nn.fractional_avg_pool
to work with tensorbuilder.core.builders.Builder
s. Instead of taking a Tensor as its first argument it takes a builder, the rest of the arguments are exactly the same.
Original Documentation for tf.nn.fractional_avg_pool
def fractional_avg_pool(value, pooling_ratio, pseudo_random=None, overlapping=None, deterministic=None, seed=None, seed2=None, name=None)
Performs fractional average pooling on the input.
Fractional average pooling is similar to Fractional max pooling in the pooling region generation step. The only difference is that after pooling regions are generated, a mean operation is performed instead of a max operation in each pooling region.
Args:
value: A Tensor
. Must be one of the following types: float32
, float64
, int32
, int64
.
4-D with shape [batch, height, width, channels]
.
pooling_ratio: A list of floats
that has length >= 4
.
Pooling ratio for each dimension of value
, currently only
supports row and col dimension and should be >= 1.0. For example, a valid
pooling ratio looks like [1.0, 1.44, 1.73, 1.0]. The first and last elements
must be 1.0 because we don't allow pooling on batch and channels
dimensions. 1.44 and 1.73 are pooling ratio on height and width dimensions
respectively.
pseudo_random: An optional bool
. Defaults to False
.
When set to True, generates the pooling sequence in a
pseudorandom fashion, otherwise, in a random fashion. Check paper [Benjamin
Graham, Fractional Max-Pooling] (http://arxiv.org/abs/1412.6071) for
difference between pseudorandom and random.
overlapping: An optional bool
. Defaults to False
.
When set to True, it means when pooling, the values at the boundary
of adjacent pooling cells are used by both cells. For example:
`index 0 1 2 3 4` `value 20 5 16 3 7` If the pooling sequence is [0, 2, 4], then 16, at index 2 will be used twice. The result would be [41/3, 26/3] for fractional avg pooling.
deterministic: An optional bool
. Defaults to False
.
When set to True, a fixed pooling region will be used when
iterating over a FractionalAvgPool node in the computation graph. Mainly used
in unit test to make FractionalAvgPool deterministic.
seed: An optional int
. Defaults to 0
.
If either seed or seed2 are set to be non-zero, the random number
generator is seeded by the given seed. Otherwise, it is seeded by a
random seed.
seed2: An optional int
. Defaults to 0
.
An second seed to avoid seed collision.
name: A name for the operation (optional).
Returns:
A tuple of Tensor
objects (output, row_pooling_sequence, col_pooling_sequence).
output: A Tensor
. Has the same type as value
. output tensor after fractional avg pooling.
row_pooling_sequence: A Tensor
of type int64
. row pooling sequence, needed to calculate gradient.
col_pooling_sequence: A Tensor
of type int64
. column pooling sequence, needed to calculate gradient.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def fractional_avg_pool_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.fractional_avg_pool_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.fractional_avg_pool_layer
Return
Applicative
Origial documentation for Builder.fractional_avg_pool_layer
def fractional_avg_pool_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.nn.fractional_avg_pool, ...)
Arguments
size
: the size of the resulting layer- All other *args and **kwargs are forwarded to
tf.contrib.layers.fully_connected
Return
Builder
Origial documentation for tf.nn.fractional_avg_pool
def fractional_avg_pool(value, pooling_ratio, pseudo_random=None, overlapping=None, deterministic=None, seed=None, seed2=None, name=None):
Performs fractional average pooling on the input.
Fractional average pooling is similar to Fractional max pooling in the pooling region generation step. The only difference is that after pooling regions are generated, a mean operation is performed instead of a max operation in each pooling region.
Args:
value: A Tensor
. Must be one of the following types: float32
, float64
, int32
, int64
.
4-D with shape [batch, height, width, channels]
.
pooling_ratio: A list of floats
that has length >= 4
.
Pooling ratio for each dimension of value
, currently only
supports row and col dimension and should be >= 1.0. For example, a valid
pooling ratio looks like [1.0, 1.44, 1.73, 1.0]. The first and last elements
must be 1.0 because we don't allow pooling on batch and channels
dimensions. 1.44 and 1.73 are pooling ratio on height and width dimensions
respectively.
pseudo_random: An optional bool
. Defaults to False
.
When set to True, generates the pooling sequence in a
pseudorandom fashion, otherwise, in a random fashion. Check paper [Benjamin
Graham, Fractional Max-Pooling] (http://arxiv.org/abs/1412.6071) for
difference between pseudorandom and random.
overlapping: An optional bool
. Defaults to False
.
When set to True, it means when pooling, the values at the boundary
of adjacent pooling cells are used by both cells. For example:
`index 0 1 2 3 4` `value 20 5 16 3 7` If the pooling sequence is [0, 2, 4], then 16, at index 2 will be used twice. The result would be [41/3, 26/3] for fractional avg pooling.
deterministic: An optional bool
. Defaults to False
.
When set to True, a fixed pooling region will be used when
iterating over a FractionalAvgPool node in the computation graph. Mainly used
in unit test to make FractionalAvgPool deterministic.
seed: An optional int
. Defaults to 0
.
If either seed or seed2 are set to be non-zero, the random number
generator is seeded by the given seed. Otherwise, it is seeded by a
random seed.
seed2: An optional int
. Defaults to 0
.
An second seed to avoid seed collision.
name: A name for the operation (optional).
Returns:
A tuple of Tensor
objects (output, row_pooling_sequence, col_pooling_sequence).
output: A Tensor
. Has the same type as value
. output tensor after fractional avg pooling.
row_pooling_sequence: A Tensor
of type int64
. row pooling sequence, needed to calculate gradient.
col_pooling_sequence: A Tensor
of type int64
. column pooling sequence, needed to calculate gradient.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def fractional_max_pool(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.fractional_max_pool, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.fractional_max_pool
Return
Applicative
Origial documentation for Builder.fractional_max_pool
def fractional_max_pool(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.nn.fractional_max_pool
to work with tensorbuilder.core.builders.Builder
s. Instead of taking a Tensor as its first argument it takes a builder, the rest of the arguments are exactly the same.
Original Documentation for tf.nn.fractional_max_pool
def fractional_max_pool(value, pooling_ratio, pseudo_random=None, overlapping=None, deterministic=None, seed=None, seed2=None, name=None)
Performs fractional max pooling on the input.
Fractional max pooling is slightly different than regular max pooling. In regular max pooling, you downsize an input set by taking the maximum value of smaller N x N subsections of the set (often 2x2), and try to reduce the set by a factor of N, where N is an integer. Fractional max pooling, as you might expect from the word "fractional", means that the overall reduction ratio N does not have to be an integer.
The sizes of the pooling regions are generated randomly but are fairly uniform. For example, let's look at the height dimension, and the constraints on the list of rows that will be pool boundaries.
First we define the following:
- input_row_length : the number of rows from the input set
- output_row_length : which will be smaller than the input
- alpha = input_row_length / output_row_length : our reduction ratio
- K = floor(alpha)
- row_pooling_sequence : this is the result list of pool boundary rows
Then, row_pooling_sequence should satisfy:
- a[0] = 0 : the first value of the sequence is 0
- a[end] = input_row_length : the last value of the sequence is the size
- K <= (a[i+1] - a[i]) <= K+1 : all intervals are K or K+1 size
- length(row_pooling_sequence) = output_row_length+1
For more details on fractional max pooling, see this paper: [Benjamin Graham, Fractional Max-Pooling] (http://arxiv.org/abs/1412.6071)
Args:
value: A Tensor
. Must be one of the following types: float32
, float64
, int32
, int64
.
4-D with shape [batch, height, width, channels]
.
pooling_ratio: A list of floats
that has length >= 4
.
Pooling ratio for each dimension of value
, currently only
supports row and col dimension and should be >= 1.0. For example, a valid
pooling ratio looks like [1.0, 1.44, 1.73, 1.0]. The first and last elements
must be 1.0 because we don't allow pooling on batch and channels
dimensions. 1.44 and 1.73 are pooling ratio on height and width dimensions
respectively.
pseudo_random: An optional bool
. Defaults to False
.
When set to True, generates the pooling sequence in a
pseudorandom fashion, otherwise, in a random fashion. Check paper [Benjamin
Graham, Fractional Max-Pooling] (http://arxiv.org/abs/1412.6071) for
difference between pseudorandom and random.
overlapping: An optional bool
. Defaults to False
.
When set to True, it means when pooling, the values at the boundary
of adjacent pooling cells are used by both cells. For example:
`index 0 1 2 3 4` `value 20 5 16 3 7` If the pooling sequence is [0, 2, 4], then 16, at index 2 will be used twice. The result would be [20, 16] for fractional max pooling.
deterministic: An optional bool
. Defaults to False
.
When set to True, a fixed pooling region will be used when
iterating over a FractionalMaxPool node in the computation graph. Mainly used
in unit test to make FractionalMaxPool deterministic.
seed: An optional int
. Defaults to 0
.
If either seed or seed2 are set to be non-zero, the random number
generator is seeded by the given seed. Otherwise, it is seeded by a
random seed.
seed2: An optional int
. Defaults to 0
.
An second seed to avoid seed collision.
name: A name for the operation (optional).
Returns:
A tuple of Tensor
objects (output, row_pooling_sequence, col_pooling_sequence).
output: A Tensor
. Has the same type as value
. output tensor after fractional max pooling.
row_pooling_sequence: A Tensor
of type int64
. row pooling sequence, needed to calculate gradient.
col_pooling_sequence: A Tensor
of type int64
. column pooling sequence, needed to calculate gradient.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def fractional_max_pool_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.fractional_max_pool_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.fractional_max_pool_layer
Return
Applicative
Origial documentation for Builder.fractional_max_pool_layer
def fractional_max_pool_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.nn.fractional_max_pool, ...)
Arguments
size
: the size of the resulting layer- All other *args and **kwargs are forwarded to
tf.contrib.layers.fully_connected
Return
Builder
Origial documentation for tf.nn.fractional_max_pool
def fractional_max_pool(value, pooling_ratio, pseudo_random=None, overlapping=None, deterministic=None, seed=None, seed2=None, name=None):
Performs fractional max pooling on the input.
Fractional max pooling is slightly different than regular max pooling. In regular max pooling, you downsize an input set by taking the maximum value of smaller N x N subsections of the set (often 2x2), and try to reduce the set by a factor of N, where N is an integer. Fractional max pooling, as you might expect from the word "fractional", means that the overall reduction ratio N does not have to be an integer.
The sizes of the pooling regions are generated randomly but are fairly uniform. For example, let's look at the height dimension, and the constraints on the list of rows that will be pool boundaries.
First we define the following:
- input_row_length : the number of rows from the input set
- output_row_length : which will be smaller than the input
- alpha = input_row_length / output_row_length : our reduction ratio
- K = floor(alpha)
- row_pooling_sequence : this is the result list of pool boundary rows
Then, row_pooling_sequence should satisfy:
- a[0] = 0 : the first value of the sequence is 0
- a[end] = input_row_length : the last value of the sequence is the size
- K <= (a[i+1] - a[i]) <= K+1 : all intervals are K or K+1 size
- length(row_pooling_sequence) = output_row_length+1
For more details on fractional max pooling, see this paper: [Benjamin Graham, Fractional Max-Pooling] (http://arxiv.org/abs/1412.6071)
Args:
value: A Tensor
. Must be one of the following types: float32
, float64
, int32
, int64
.
4-D with shape [batch, height, width, channels]
.
pooling_ratio: A list of floats
that has length >= 4
.
Pooling ratio for each dimension of value
, currently only
supports row and col dimension and should be >= 1.0. For example, a valid
pooling ratio looks like [1.0, 1.44, 1.73, 1.0]. The first and last elements
must be 1.0 because we don't allow pooling on batch and channels
dimensions. 1.44 and 1.73 are pooling ratio on height and width dimensions
respectively.
pseudo_random: An optional bool
. Defaults to False
.
When set to True, generates the pooling sequence in a
pseudorandom fashion, otherwise, in a random fashion. Check paper [Benjamin
Graham, Fractional Max-Pooling] (http://arxiv.org/abs/1412.6071) for
difference between pseudorandom and random.
overlapping: An optional bool
. Defaults to False
.
When set to True, it means when pooling, the values at the boundary
of adjacent pooling cells are used by both cells. For example:
`index 0 1 2 3 4` `value 20 5 16 3 7` If the pooling sequence is [0, 2, 4], then 16, at index 2 will be used twice. The result would be [20, 16] for fractional max pooling.
deterministic: An optional bool
. Defaults to False
.
When set to True, a fixed pooling region will be used when
iterating over a FractionalMaxPool node in the computation graph. Mainly used
in unit test to make FractionalMaxPool deterministic.
seed: An optional int
. Defaults to 0
.
If either seed or seed2 are set to be non-zero, the random number
generator is seeded by the given seed. Otherwise, it is seeded by a
random seed.
seed2: An optional int
. Defaults to 0
.
An second seed to avoid seed collision.
name: A name for the operation (optional).
Returns:
A tuple of Tensor
objects (output, row_pooling_sequence, col_pooling_sequence).
output: A Tensor
. Has the same type as value
. output tensor after fractional max pooling.
row_pooling_sequence: A Tensor
of type int64
. row pooling sequence, needed to calculate gradient.
col_pooling_sequence: A Tensor
of type int64
. column pooling sequence, needed to calculate gradient.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def fully_connected(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.fully_connected, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.fully_connected
Return
Applicative
Origial documentation for Builder.fully_connected
def fully_connected(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.contrib.layers.fully_connected
to work with tensorbuilder.core.builders.Builder
s. Instead of taking a Tensor as its first argument it takes a builder, the rest of the arguments are exactly the same.
Original Documentation for tf.contrib.layers.fully_connected
def fully_connected()
Adds a fully connected layer.
fully_connected
creates a variable called weights
, representing a fully
connected weight matrix, which is multiplied by the inputs
to produce a
Tensor
of hidden units. If a normalizer_fn
is provided (such as
batch_norm
), it is then applied. Otherwise, if normalizer_fn
is
None and a biases_initializer
is provided then a biases
variable would be
created and added the hidden units. Finally, if activation_fn
is not None
,
it is applied to the hidden units as well.
Note: that if inputs
have a rank greater than 2, then inputs
is flattened
prior to the initial matrix multiply by weights
.
Args:
inputs: A tensor of with at least rank 2 and value for the last dimension,
i.e. [batch_size, depth]
, [None, None, None, channels]
.
num_outputs: Integer or long, the number of output units in the layer.
activation_fn: activation function, set to None to skip it and maintain
a linear activation.
normalizer_fn: normalization function to use instead of biases
. If
normalizer_fn
is provided then biases_initializer
and
biases_regularizer
are ignored and biases
are not created nor added.
default set to None for no normalizer function
normalizer_params: normalization function parameters.
weights_initializer: An initializer for the weights.
weights_regularizer: Optional regularizer for the weights.
biases_initializer: An initializer for the biases. If None skip biases.
biases_regularizer: Optional regularizer for the biases.
reuse: whether or not the layer and its variables should be reused. To be
able to reuse the layer scope must be given.
variables_collections: Optional list of collections for all the variables or
a dictionary containing a different list of collections per variable.
outputs_collections: collection to add the outputs.
trainable: If True
also add variables to the graph collection
GraphKeys.TRAINABLE_VARIABLES
(see tf.Variable).
scope: Optional scope for variable_scope.
Returns: the tensor variable representing the result of the series of operations.
Raises: ValueError: if x has rank less than 2 or if its last dimension is not set.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def fully_connected_from_product(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.fully_connected_from_product, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.fully_connected_from_product
Return
Applicative
Origial documentation for Builder.fully_connected_from_product
def fully_connected_from_product(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tensorbuilder.fully_connected_from_product
to work with tensorbuilder.core.builders.Builder
s. Instead of taking a Tensor as its first argument it takes a builder, the rest of the arguments are exactly the same.
Original Documentation for tensorbuilder.fully_connected_from_product
def fully_connected_from_product()
Adds a fully connected layer.
fully_connected
creates a variable called weights
, representing a fully
connected weight matrix, which is multiplied by the inputs
to produce a
Tensor
of hidden units. If a normalizer_fn
is provided (such as
batch_norm
), it is then applied. Otherwise, if normalizer_fn
is
None and a biases_initializer
is provided then a biases
variable would be
created and added the hidden units. Finally, if activation_fn
is not None
,
it is applied to the hidden units as well.
Note: that if inputs
have a rank greater than 2, then inputs
is flattened
prior to the initial matrix multiply by weights
.
Args:
inputs: A tensor of with at least rank 2 and value for the last dimension,
i.e. [batch_size, depth]
, [None, None, None, channels]
.
num_outputs: Integer, the number of output units in the layer.
activation_fn: activation function.
normalizer_fn: normalization function to use instead of biases
. If
normalize_fn
is provided then biases_initializer
and
biases_regularizer
are ignored and biases
are not created nor added.
normalizer_params: normalization function parameters.
weights_initializer: An initializer for the weights.
weights_regularizer: Optional regularizer for the weights.
biases_initializer: An initializer for the biases. If None skip biases.
biases_regularizer: Optional regularizer for the biases.
reuse: whether or not the layer and its variables should be reused. To be
able to reuse the layer scope must be given.
variables_collections: Optional list of collections for all the variables or
a dictionary containing a different list of collections per variable.
outputs_collections: collection to add the outputs.
trainable: If True
also add variables to the graph collection
GraphKeys.TRAINABLE_VARIABLES
(see tf.Variable).
scope: Optional scope for variable_op_scope.
Returns:
the tensor variable representing the result of the series of operations.
Raises:
ValueError: if x has rank less than 2 or if its last dimension is not set.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def fused_resize_and_pad_conv2d(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.fused_resize_and_pad_conv2d, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.fused_resize_and_pad_conv2d
Return
Applicative
Origial documentation for Builder.fused_resize_and_pad_conv2d
def fused_resize_and_pad_conv2d(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.nn.fused_resize_and_pad_conv2d
to work with tensorbuilder.core.builders.Builder
s. Instead of taking a Tensor as its first argument it takes a builder, the rest of the arguments are exactly the same.
Original Documentation for tf.nn.fused_resize_and_pad_conv2d
def fused_resize_and_pad_conv2d(input, size, paddings, filter, mode, strides, padding, resize_align_corners=None, name=None)
Performs a resize and padding as a preprocess during a convolution.
It's often possible to do spatial transformations more efficiently as part of the packing stage of a convolution, so this op allows for an optimized implementation where these stages are fused together. This prevents the need to write out the intermediate results as whole tensors, reducing memory pressure, and we can get some latency gains by merging the transformation calculations. The data_format attribute for Conv2D isn't supported by this op, and defaults to 'NHWC' order. Internally this op uses a single per-graph scratch buffer, which means that it will block if multiple versions are being run in parallel. This is because this operator is primarily an optimization to minimize memory usage.
Args:
input: A Tensor
. Must be one of the following types: half
, float32
, float64
.
4-D with shape [batch, in_height, in_width, in_channels]
.
size: A Tensor
of type int32
.
A 1-D int32 Tensor of 2 elements: new_height, new_width
. The
new size for the images.
paddings: A Tensor
of type int32
.
A two-column matrix specifying the padding sizes. The number of
rows must be the same as the rank of input
.
filter: A Tensor
. Must have the same type as input
. 4-D with shape
[filter_height, filter_width, in_channels, out_channels]
.
mode: A string
from: "REFLECT", "SYMMETRIC"
.
strides: A list of ints
.
1-D of length 4. The stride of the sliding window for each dimension
of input
. Must be in the same order as the dimension specified with format.
padding: A string
from: "SAME", "VALID"
.
The type of padding algorithm to use.
resize_align_corners: An optional bool
. Defaults to False
.
If true, rescale input by (new_height - 1) / (height - 1),
which exactly aligns the 4 corners of images and resized images. If false, rescale
by new_height / height. Treat similarly the width dimension.
name: A name for the operation (optional).
Returns:
A Tensor
. Has the same type as input
.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def fused_resize_and_pad_conv2d_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.fused_resize_and_pad_conv2d_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.fused_resize_and_pad_conv2d_layer
Return
Applicative
Origial documentation for Builder.fused_resize_and_pad_conv2d_layer
def fused_resize_and_pad_conv2d_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.nn.fused_resize_and_pad_conv2d, ...)
Arguments
size
: the size of the resulting layer- All other *args and **kwargs are forwarded to
tf.contrib.layers.fully_connected
Return
Builder
Origial documentation for tf.nn.fused_resize_and_pad_conv2d
def fused_resize_and_pad_conv2d(input, size, paddings, filter, mode, strides, padding, resize_align_corners=None, name=None):
Performs a resize and padding as a preprocess during a convolution.
It's often possible to do spatial transformations more efficiently as part of the packing stage of a convolution, so this op allows for an optimized implementation where these stages are fused together. This prevents the need to write out the intermediate results as whole tensors, reducing memory pressure, and we can get some latency gains by merging the transformation calculations. The data_format attribute for Conv2D isn't supported by this op, and defaults to 'NHWC' order. Internally this op uses a single per-graph scratch buffer, which means that it will block if multiple versions are being run in parallel. This is because this operator is primarily an optimization to minimize memory usage.
Args:
input: A Tensor
. Must be one of the following types: half
, float32
, float64
.
4-D with shape [batch, in_height, in_width, in_channels]
.
size: A Tensor
of type int32
.
A 1-D int32 Tensor of 2 elements: new_height, new_width
. The
new size for the images.
paddings: A Tensor
of type int32
.
A two-column matrix specifying the padding sizes. The number of
rows must be the same as the rank of input
.
filter: A Tensor
. Must have the same type as input
. 4-D with shape
[filter_height, filter_width, in_channels, out_channels]
.
mode: A string
from: "REFLECT", "SYMMETRIC"
.
strides: A list of ints
.
1-D of length 4. The stride of the sliding window for each dimension
of input
. Must be in the same order as the dimension specified with format.
padding: A string
from: "SAME", "VALID"
.
The type of padding algorithm to use.
resize_align_corners: An optional bool
. Defaults to False
.
If true, rescale input by (new_height - 1) / (height - 1),
which exactly aligns the 4 corners of images and resized images. If false, rescale
by new_height / height. Treat similarly the width dimension.
name: A name for the operation (optional).
Returns:
A Tensor
. Has the same type as input
.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def gather(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.gather, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.gather
Return
Applicative
Origial documentation for Builder.gather
def gather(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.gather
to work with tensorbuilder.core.builders.Builder
s. Instead of taking a Tensor as its first argument it takes a builder, the rest of the arguments are exactly the same.
Original Documentation for tf.gather
def gather(params, indices, validate_indices=None, name=None)
Gather slices from params
according to indices
.
indices
must be an integer tensor of any dimension (usually 0-D or 1-D).
Produces an output tensor with shape indices.shape + params.shape[1:]
where:
# Scalar indices output[:, ..., :] = params[indices, :, ... :] # Vector indices output[i, :, ..., :] = params[indices[i], :, ... :] # Higher rank indices output[i, ..., j, :, ... :] = params[indices[i, ..., j], :, ..., :]
If indices
is a permutation and len(indices) == params.shape[0]
then
this operation will permute params
accordingly.
Args:
params: A Tensor
.
indices: A Tensor
. Must be one of the following types: int32
, int64
.
validate_indices: An optional bool
. Defaults to True
.
name: A name for the operation (optional).
Returns:
A Tensor
. Has the same type as params
.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def gather_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.gather_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.gather_layer
Return
Applicative
Origial documentation for Builder.gather_layer
def gather_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.gather, ...)
Arguments
size
: the size of the resulting layer- All other *args and **kwargs are forwarded to
tf.contrib.layers.fully_connected
Return
Builder
Origial documentation for tf.gather
def gather(params, indices, validate_indices=None, name=None):
Gather slices from params
according to indices
.
indices
must be an integer tensor of any dimension (usually 0-D or 1-D).
Produces an output tensor with shape indices.shape + params.shape[1:]
where:
# Scalar indices output[:, ..., :] = params[indices, :, ... :] # Vector indices output[i, :, ..., :] = params[indices[i], :, ... :] # Higher rank indices output[i, ..., j, :, ... :] = params[indices[i, ..., j], :, ..., :]
If indices
is a permutation and len(indices) == params.shape[0]
then
this operation will permute params
accordingly.
Args:
params: A Tensor
.
indices: A Tensor
. Must be one of the following types: int32
, int64
.
validate_indices: An optional bool
. Defaults to True
.
name: A name for the operation (optional).
Returns:
A Tensor
. Has the same type as params
.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def gather_nd(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.gather_nd, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.gather_nd
Return
Applicative
Origial documentation for Builder.gather_nd
def gather_nd(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.gather_nd
to work with tensorbuilder.core.builders.Builder
s. Instead of taking a Tensor as its first argument it takes a builder, the rest of the arguments are exactly the same.
Original Documentation for tf.gather_nd
def gather_nd(params, indices, name=None)
Gather values or slices from params
according to indices
.
params
is a Tensor of rank R
and indices
is a Tensor of rank M
.
indices
must be integer tensor, containing indices into params
.
It must be shape [d_0, ..., d_N, R]
where 0 < R <= M
.
The innermost dimension of indices
(with length R
) corresponds to
indices into elements (if R = M
) or slices (if R < M
) along the N
th
dimension of params
.
Produces an output tensor with shape
[d_0, ..., d_{n-1}, params.shape[R], ..., params.shape[M-1]].
Some examples below.
Simple indexing into a matrix:
indices = [[0, 0], [1, 1]] params = [['a', 'b'], ['c', 'd']] output = ['a', 'd']
Slice indexing into a matrix:
indices = [[1], [0]] params = [['a', 'b'], ['c', 'd']] output = [['c', 'd'], ['a', 'b']]
Indexing into a 3-tensor:
indices = [[1]] params = [[['a0', 'b0'], ['c0', 'd0']], [['a1', 'b1'], ['c1', 'd1']]] output = [[['a1', 'b1'], ['c1', 'd1']]] indices = [[0, 1], [1, 0]] params = [[['a0', 'b0'], ['c0', 'd0']], [['a1', 'b1'], ['c1', 'd1']]] output = [['c0', 'd0'], ['a1', 'b1']] indices = [[0, 0, 1], [1, 0, 1]] params = [[['a0', 'b0'], ['c0', 'd0']], [['a1', 'b1'], ['c1', 'd1']]] output = ['b0', 'b1']
Batched indexing into a matrix:
indices = [[[0, 0]], [[0, 1]]] params = [['a', 'b'], ['c', 'd']] output = [['a'], ['b']]
Batched slice indexing into a matrix:
indices = [[[1]], [[0]]] params = [['a', 'b'], ['c', 'd']] output = [[['c', 'd']], [['a', 'b']]]
Batched indexing into a 3-tensor:
indices = [[[1]], [[0]]] params = [[['a0', 'b0'], ['c0', 'd0']], [['a1', 'b1'], ['c1', 'd1']]] output = [[[['a1', 'b1'], ['c1', 'd1']]], [[['a0', 'b0'], ['c0', 'd0']]]] indices = [[[0, 1], [1, 0]], [[0, 0], [1, 1]]] params = [[['a0', 'b0'], ['c0', 'd0']], [['a1', 'b1'], ['c1', 'd1']]] output = [[['c0', 'd0'], ['a1', 'b1']], [['a0', 'b0'], ['c1', 'd1']]] indices = [[[0, 0, 1], [1, 0, 1]], [[0, 1, 1], [1, 1, 0]]] params = [[['a0', 'b0'], ['c0', 'd0']], [['a1', 'b1'], ['c1', 'd1']]] output = [['b0', 'b1'], ['d0', 'c1']]
Args:
params: A Tensor
. M-D
. The tensor from which to gather values.
indices: A Tensor
. Must be one of the following types: int32
, int64
.
(N+1)-D
. Index tensor having shape [d_0, ..., d_N, R]
.
name: A name for the operation (optional).
Returns:
A Tensor
. Has the same type as params
.
(N+M-R)-D
. Values from params
gathered from indices given by
indices
.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def gather_nd_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.gather_nd_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.gather_nd_layer
Return
Applicative
Origial documentation for Builder.gather_nd_layer
def gather_nd_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.gather_nd, ...)
Arguments
size
: the size of the resulting layer- All other *args and **kwargs are forwarded to
tf.contrib.layers.fully_connected
Return
Builder
Origial documentation for tf.gather_nd
def gather_nd(params, indices, name=None):
Gather values or slices from params
according to indices
.
params
is a Tensor of rank R
and indices
is a Tensor of rank M
.
indices
must be integer tensor, containing indices into params
.
It must be shape [d_0, ..., d_N, R]
where 0 < R <= M
.
The innermost dimension of indices
(with length R
) corresponds to
indices into elements (if R = M
) or slices (if R < M
) along the N
th
dimension of params
.
Produces an output tensor with shape
[d_0, ..., d_{n-1}, params.shape[R], ..., params.shape[M-1]].
Some examples below.
Simple indexing into a matrix:
indices = [[0, 0], [1, 1]] params = [['a', 'b'], ['c', 'd']] output = ['a', 'd']
Slice indexing into a matrix:
indices = [[1], [0]] params = [['a', 'b'], ['c', 'd']] output = [['c', 'd'], ['a', 'b']]
Indexing into a 3-tensor:
indices = [[1]] params = [[['a0', 'b0'], ['c0', 'd0']], [['a1', 'b1'], ['c1', 'd1']]] output = [[['a1', 'b1'], ['c1', 'd1']]] indices = [[0, 1], [1, 0]] params = [[['a0', 'b0'], ['c0', 'd0']], [['a1', 'b1'], ['c1', 'd1']]] output = [['c0', 'd0'], ['a1', 'b1']] indices = [[0, 0, 1], [1, 0, 1]] params = [[['a0', 'b0'], ['c0', 'd0']], [['a1', 'b1'], ['c1', 'd1']]] output = ['b0', 'b1']
Batched indexing into a matrix:
indices = [[[0, 0]], [[0, 1]]] params = [['a', 'b'], ['c', 'd']] output = [['a'], ['b']]
Batched slice indexing into a matrix:
indices = [[[1]], [[0]]] params = [['a', 'b'], ['c', 'd']] output = [[['c', 'd']], [['a', 'b']]]
Batched indexing into a 3-tensor:
indices = [[[1]], [[0]]] params = [[['a0', 'b0'], ['c0', 'd0']], [['a1', 'b1'], ['c1', 'd1']]] output = [[[['a1', 'b1'], ['c1', 'd1']]], [[['a0', 'b0'], ['c0', 'd0']]]] indices = [[[0, 1], [1, 0]], [[0, 0], [1, 1]]] params = [[['a0', 'b0'], ['c0', 'd0']], [['a1', 'b1'], ['c1', 'd1']]] output = [[['c0', 'd0'], ['a1', 'b1']], [['a0', 'b0'], ['c1', 'd1']]] indices = [[[0, 0, 1], [1, 0, 1]], [[0, 1, 1], [1, 1, 0]]] params = [[['a0', 'b0'], ['c0', 'd0']], [['a1', 'b1'], ['c1', 'd1']]] output = [['b0', 'b1'], ['d0', 'c1']]
Args:
params: A Tensor
. M-D
. The tensor from which to gather values.
indices: A Tensor
. Must be one of the following types: int32
, int64
.
(N+1)-D
. Index tensor having shape [d_0, ..., d_N, R]
.
name: A name for the operation (optional).
Returns:
A Tensor
. Has the same type as params
.
(N+M-R)-D
. Values from params
gathered from indices given by
indices
.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def get_collection(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.get_collection, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.get_collection
Return
Applicative
Origial documentation for Builder.get_collection
def get_collection(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.get_collection
to work with tensorbuilder.core.builders.Builder
s. Instead of taking a Tensor as its first argument it takes a builder, the rest of the arguments are exactly the same.
Original Documentation for tf.get_collection
def get_collection(key, scope=None)
Wrapper for Graph.get_collection()
using the default graph.
See Graph.get_collection()
for more details.
Args:
key: The key for the collection. For example, the GraphKeys
class
contains many standard names for collections.
scope: (Optional.) If supplied, the resulting list is filtered to include
only items whose name
attribute matches using re.match
. Items
without a name
attribute are never returned if a scope is supplied and
the choice or re.match
means that a scope
without special tokens
filters by prefix.
Returns:
The list of values in the collection with the given name
, or
an empty list if no value has been added to that collection. The
list contains the values in the order under which they were
collected.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def get_collection_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.get_collection_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.get_collection_layer
Return
Applicative
Origial documentation for Builder.get_collection_layer
def get_collection_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.get_collection, ...)
Arguments
size
: the size of the resulting layer- All other *args and **kwargs are forwarded to
tf.contrib.layers.fully_connected
Return
Builder
Origial documentation for tf.get_collection
def get_collection(key, scope=None):
Wrapper for Graph.get_collection()
using the default graph.
See Graph.get_collection()
for more details.
Args:
key: The key for the collection. For example, the GraphKeys
class
contains many standard names for collections.
scope: (Optional.) If supplied, the resulting list is filtered to include
only items whose name
attribute matches using re.match
. Items
without a name
attribute are never returned if a scope is supplied and
the choice or re.match
means that a scope
without special tokens
filters by prefix.
Returns:
The list of values in the collection with the given name
, or
an empty list if no value has been added to that collection. The
list contains the values in the order under which they were
collected.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def get_collection_ref(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.get_collection_ref, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.get_collection_ref
Return
Applicative
Origial documentation for Builder.get_collection_ref
def get_collection_ref(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.get_collection_ref
to work with tensorbuilder.core.builders.Builder
s. Instead of taking a Tensor as its first argument it takes a builder, the rest of the arguments are exactly the same.
Original Documentation for tf.get_collection_ref
def get_collection_ref(key)
Wrapper for Graph.get_collection_ref()
using the default graph.
See Graph.get_collection_ref()
for more details.
Args:
key: The key for the collection. For example, the GraphKeys
class
contains many standard names for collections.
Returns:
The list of values in the collection with the given name
, or an empty
list if no value has been added to that collection. Note that this returns
the collection list itself, which can be modified in place to change the
collection.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def get_collection_ref_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.get_collection_ref_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.get_collection_ref_layer
Return
Applicative
Origial documentation for Builder.get_collection_ref_layer
def get_collection_ref_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.get_collection_ref, ...)
Arguments
size
: the size of the resulting layer- All other *args and **kwargs are forwarded to
tf.contrib.layers.fully_connected
Return
Builder
Origial documentation for tf.get_collection_ref
def get_collection_ref(key):
Wrapper for Graph.get_collection_ref()
using the default graph.
See Graph.get_collection_ref()
for more details.
Args:
key: The key for the collection. For example, the GraphKeys
class
contains many standard names for collections.
Returns:
The list of values in the collection with the given name
, or an empty
list if no value has been added to that collection. Note that this returns
the collection list itself, which can be modified in place to change the
collection.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def get_default_graph(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.get_default_graph, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.get_default_graph
Return
Applicative
Origial documentation for Builder.get_default_graph
def get_default_graph(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.get_default_graph
to work with tensorbuilder.core.builders.Builder
s. Instead of taking a Tensor as its first argument it takes a builder, the rest of the arguments are exactly the same.
Original Documentation for tf.get_default_graph
def get_default_graph()
Returns the default graph for the current thread.
The returned graph will be the innermost graph on which a
Graph.as_default()
context has been entered, or a global default
graph if none has been explicitly created.
NOTE: The default graph is a property of the current thread. If you
create a new thread, and wish to use the default graph in that
thread, you must explicitly add a with g.as_default():
in that
thread's function.
Returns:
The default Graph
being used in the current thread.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def get_default_graph_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.get_default_graph_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.get_default_graph_layer
Return
Applicative
Origial documentation for Builder.get_default_graph_layer
def get_default_graph_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.get_default_graph, ...)
Arguments
size
: the size of the resulting layer- All other *args and **kwargs are forwarded to
tf.contrib.layers.fully_connected
Return
Builder
Origial documentation for tf.get_default_graph
def get_default_graph():
Returns the default graph for the current thread.
The returned graph will be the innermost graph on which a
Graph.as_default()
context has been entered, or a global default
graph if none has been explicitly created.
NOTE: The default graph is a property of the current thread. If you
create a new thread, and wish to use the default graph in that
thread, you must explicitly add a with g.as_default():
in that
thread's function.
Returns:
The default Graph
being used in the current thread.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def get_default_session(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.get_default_session, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.get_default_session
Return
Applicative
Origial documentation for Builder.get_default_session
def get_default_session(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.get_default_session
to work with tensorbuilder.core.builders.Builder
s. Instead of taking a Tensor as its first argument it takes a builder, the rest of the arguments are exactly the same.
Original Documentation for tf.get_default_session
def get_default_session()
Returns the default session for the current thread.
The returned Session
will be the innermost session on which a
Session
or Session.as_default()
context has been entered.
NOTE: The default session is a property of the current thread. If you
create a new thread, and wish to use the default session in that
thread, you must explicitly add a with sess.as_default():
in that
thread's function.
Returns:
The default Session
being used in the current thread.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def get_default_session_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.get_default_session_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.get_default_session_layer
Return
Applicative
Origial documentation for Builder.get_default_session_layer
def get_default_session_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.get_default_session, ...)
Arguments
size
: the size of the resulting layer- All other *args and **kwargs are forwarded to
tf.contrib.layers.fully_connected
Return
Builder
Origial documentation for tf.get_default_session
def get_default_session():
Returns the default session for the current thread.
The returned Session
will be the innermost session on which a
Session
or Session.as_default()
context has been entered.
NOTE: The default session is a property of the current thread. If you
create a new thread, and wish to use the default session in that
thread, you must explicitly add a with sess.as_default():
in that
thread's function.
Returns:
The default Session
being used in the current thread.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def get_seed(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.get_seed, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.get_seed
Return
Applicative
Origial documentation for Builder.get_seed
def get_seed(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.get_seed
to work with tensorbuilder.core.builders.Builder
s. Instead of taking a Tensor as its first argument it takes a builder, the rest of the arguments are exactly the same.
Original Documentation for tf.get_seed
def get_seed(op_seed)
Returns the local seeds an operation should use given an op-specific seed.
Given operation-specific seed, op_seed
, this helper function returns two
seeds derived from graph-level and op-level seeds. Many random operations
internally use the two seeds to allow user to change the seed globally for a
graph, or for only specific operations.
For details on how the graph-level seed interacts with op seeds, see
set_random_seed
.
Args: op_seed: integer.
Returns: A tuple of two integers that should be used for the local seed of this operation.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def get_seed_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.get_seed_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.get_seed_layer
Return
Applicative
Origial documentation for Builder.get_seed_layer
def get_seed_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.get_seed, ...)
Arguments
size
: the size of the resulting layer- All other *args and **kwargs are forwarded to
tf.contrib.layers.fully_connected
Return
Builder
Origial documentation for tf.get_seed
def get_seed(op_seed):
Returns the local seeds an operation should use given an op-specific seed.
Given operation-specific seed, op_seed
, this helper function returns two
seeds derived from graph-level and op-level seeds. Many random operations
internally use the two seeds to allow user to change the seed globally for a
graph, or for only specific operations.
For details on how the graph-level seed interacts with op seeds, see
set_random_seed
.
Args: op_seed: integer.
Returns: A tuple of two integers that should be used for the local seed of this operation.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def get_session_handle(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.get_session_handle, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.get_session_handle
Return
Applicative
Origial documentation for Builder.get_session_handle
def get_session_handle(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.get_session_handle
to work with tensorbuilder.core.builders.Builder
s. Instead of taking a Tensor as its first argument it takes a builder, the rest of the arguments are exactly the same.
Original Documentation for tf.get_session_handle
def get_session_handle(data, name=None)
Return the handle of data
.
This is EXPERIMENTAL and subject to change.
Keep data
"in-place" in the runtime and create a handle that can be
used to retrieve data
in a subsequent run().
Combined with get_session_tensor
, we can keep a tensor produced in
one run call in place, and use it as the input in a future run call.
Args: data: A tensor to be stored in the session. name: Optional name prefix for the return tensor.
Returns:
A scalar string tensor representing a unique handle for data
.
Raises:
TypeError: if data
is not a Tensor.
Example:
```python c = tf.mul(a, b) h = tf.get_session_handle(c) h = sess.run(h)
p, a = tf.get_session_tensor(h.handle, tf.float32) b = tf.mul(a, 10) c = sess.run(b, feed_dict={p: h.handle}) ```
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def get_session_handle_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.get_session_handle_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.get_session_handle_layer
Return
Applicative
Origial documentation for Builder.get_session_handle_layer
def get_session_handle_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.get_session_handle, ...)
Arguments
size
: the size of the resulting layer- All other *args and **kwargs are forwarded to
tf.contrib.layers.fully_connected
Return
Builder
Origial documentation for tf.get_session_handle
def get_session_handle(data, name=None):
Return the handle of data
.
This is EXPERIMENTAL and subject to change.
Keep data
"in-place" in the runtime and create a handle that can be
used to retrieve data
in a subsequent run().
Combined with get_session_tensor
, we can keep a tensor produced in
one run call in place, and use it as the input in a future run call.
Args: data: A tensor to be stored in the session. name: Optional name prefix for the return tensor.
Returns:
A scalar string tensor representing a unique handle for data
.
Raises:
TypeError: if data
is not a Tensor.
Example:
```python c = tf.mul(a, b) h = tf.get_session_handle(c) h = sess.run(h)
p, a = tf.get_session_tensor(h.handle, tf.float32) b = tf.mul(a, 10) c = sess.run(b, feed_dict={p: h.handle}) ```
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def get_session_tensor(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.get_session_tensor, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.get_session_tensor
Return
Applicative
Origial documentation for Builder.get_session_tensor
def get_session_tensor(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.get_session_tensor
to work with tensorbuilder.core.builders.Builder
s. Instead of taking a Tensor as its first argument it takes a builder, the rest of the arguments are exactly the same.
Original Documentation for tf.get_session_tensor
def get_session_tensor(handle, dtype, name=None)
Get the tensor of type dtype
by feeding a tensor handle.
This is EXPERIMENTAL and subject to change.
Get the value of the tensor from a tensor handle. The tensor is produced in a previous run() and stored in the state of the session.
Args: handle: The string representation of a persistent tensor handle. dtype: The type of the output tensor. name: Optional name prefix for the return tensor.
Returns: A pair of tensors. The first is a placeholder for feeding a tensor handle and the second is the tensor in the session state keyed by the tensor handle.
Example:
```python c = tf.mul(a, b) h = tf.get_session_handle(c) h = sess.run(h)
p, a = tf.get_session_tensor(h.handle, tf.float32) b = tf.mul(a, 10) c = sess.run(b, feed_dict={p: h.handle}) ```
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def get_session_tensor_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.get_session_tensor_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.get_session_tensor_layer
Return
Applicative
Origial documentation for Builder.get_session_tensor_layer
def get_session_tensor_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.get_session_tensor, ...)
Arguments
size
: the size of the resulting layer- All other *args and **kwargs are forwarded to
tf.contrib.layers.fully_connected
Return
Builder
Origial documentation for tf.get_session_tensor
def get_session_tensor(handle, dtype, name=None):
Get the tensor of type dtype
by feeding a tensor handle.
This is EXPERIMENTAL and subject to change.
Get the value of the tensor from a tensor handle. The tensor is produced in a previous run() and stored in the state of the session.
Args: handle: The string representation of a persistent tensor handle. dtype: The type of the output tensor. name: Optional name prefix for the return tensor.
Returns: A pair of tensors. The first is a placeholder for feeding a tensor handle and the second is the tensor in the session state keyed by the tensor handle.
Example:
```python c = tf.mul(a, b) h = tf.get_session_handle(c) h = sess.run(h)
p, a = tf.get_session_tensor(h.handle, tf.float32) b = tf.mul(a, 10) c = sess.run(b, feed_dict={p: h.handle}) ```
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def get_variable(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.get_variable, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.get_variable
Return
Applicative
Origial documentation for Builder.get_variable
def get_variable(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.get_variable
to work with tensorbuilder.core.builders.Builder
s. Instead of taking a Tensor as its first argument it takes a builder, the rest of the arguments are exactly the same.
Original Documentation for tf.get_variable
def get_variable(name, shape=None, dtype=None, initializer=None, regularizer=None, trainable=True, collections=None, caching_device=None, partitioner=None, validate_shape=True, custom_getter=None)
Gets an existing variable with these parameters or create a new one.
This function prefixes the name with the current variable scope and performs reuse checks. See the Variable Scope How To for an extensive description of how reusing works. Here is a basic example:
python
with tf.variable_scope("foo"):
v = tf.get_variable("v", [1]) # v.name == "foo/v:0"
w = tf.get_variable("w", [1]) # w.name == "foo/w:0"
with tf.variable_scope("foo", reuse=True)
v1 = tf.get_variable("v") # The same as v above.
If initializer is None
(the default), the default initializer passed in
the variable scope will be used. If that one is None
too, a
uniform_unit_scaling_initializer
will be used. The initializer can also be
a Tensor, in which case the variable is initialized to this value and shape.
Similarly, if the regularizer is None
(the default), the default regularizer
passed in the variable scope will be used (if that is None
too,
then by default no regularization is performed).
If a partitioner is provided, first a sharded Variable
is created
via _get_partitioned_variable
, and the return value is a
Tensor
composed of the shards concatenated along the partition axis.
Some useful partitioners are available. See, e.g.,
variable_axis_size_partitioner
and min_max_variable_partitioner
.
Args:
name: The name of the new or existing variable.
shape: Shape of the new or existing variable.
dtype: Type of the new or existing variable (defaults to DT_FLOAT
).
initializer: Initializer for the variable if one is created.
regularizer: A (Tensor -> Tensor or None) function; the result of
applying it on a newly created variable will be added to the collection
GraphKeys.REGULARIZATION_LOSSES and can be used for regularization.
trainable: If True
also add the variable to the graph collection
GraphKeys.TRAINABLE_VARIABLES
(see tf.Variable).
collections: List of graph collections keys to add the Variable to.
Defaults to [GraphKeys.VARIABLES]
(see tf.Variable).
caching_device: Optional device string or function describing where the
Variable should be cached for reading. Defaults to the Variable's
device. If not None
, caches on another device. Typical use is to
cache on the device where the Ops using the Variable reside, to
deduplicate copying through Switch
and other conditional statements.
partitioner: Optional callable that accepts a fully defined TensorShape
and dtype
of the Variable to be created, and returns a list of
partitions for each axis (currently only one axis can be partitioned).
validate_shape: If False, allows the variable to be initialized with a
value of unknown shape. If True, the default, the shape of initial_value
must be known.
custom_getter: Callable that takes as a first argument the true getter, and
allows overwriting the internal get_variable method.
The signature of custom_getter
should match that of this method,
but the most future-proof version will allow for changes:
def custom_getter(getter, *args, **kwargs)
. Direct access to
all get_variable
parameters is also allowed:
def custom_getter(getter, name, *args, **kwargs)
. A simple identity
custom getter that simply creates variables with modified names is:
python
def custom_getter(getter, name, *args, **kwargs):
return getter(name + '_suffix', *args, **kwargs)
Returns: The created or existing variable.
Raises:
ValueError: when creating a new variable and shape is not declared,
when violating reuse during variable creation, or when initializer
dtype
and dtype
don't match. Reuse is set inside variable_scope
.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def get_variable_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.get_variable_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.get_variable_layer
Return
Applicative
Origial documentation for Builder.get_variable_layer
def get_variable_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.get_variable, ...)
Arguments
size
: the size of the resulting layer- All other *args and **kwargs are forwarded to
tf.contrib.layers.fully_connected
Return
Builder
Origial documentation for tf.get_variable
def get_variable(name, shape=None, dtype=None, initializer=None, regularizer=None, trainable=True, collections=None, caching_device=None, partitioner=None, validate_shape=True, custom_getter=None):
Gets an existing variable with these parameters or create a new one.
This function prefixes the name with the current variable scope and performs reuse checks. See the Variable Scope How To for an extensive description of how reusing works. Here is a basic example:
python
with tf.variable_scope("foo"):
v = tf.get_variable("v", [1]) # v.name == "foo/v:0"
w = tf.get_variable("w", [1]) # w.name == "foo/w:0"
with tf.variable_scope("foo", reuse=True)
v1 = tf.get_variable("v") # The same as v above.
If initializer is None
(the default), the default initializer passed in
the variable scope will be used. If that one is None
too, a
uniform_unit_scaling_initializer
will be used. The initializer can also be
a Tensor, in which case the variable is initialized to this value and shape.
Similarly, if the regularizer is None
(the default), the default regularizer
passed in the variable scope will be used (if that is None
too,
then by default no regularization is performed).
If a partitioner is provided, first a sharded Variable
is created
via _get_partitioned_variable
, and the return value is a
Tensor
composed of the shards concatenated along the partition axis.
Some useful partitioners are available. See, e.g.,
variable_axis_size_partitioner
and min_max_variable_partitioner
.
Args:
name: The name of the new or existing variable.
shape: Shape of the new or existing variable.
dtype: Type of the new or existing variable (defaults to DT_FLOAT
).
initializer: Initializer for the variable if one is created.
regularizer: A (Tensor -> Tensor or None) function; the result of
applying it on a newly created variable will be added to the collection
GraphKeys.REGULARIZATION_LOSSES and can be used for regularization.
trainable: If True
also add the variable to the graph collection
GraphKeys.TRAINABLE_VARIABLES
(see tf.Variable).
collections: List of graph collections keys to add the Variable to.
Defaults to [GraphKeys.VARIABLES]
(see tf.Variable).
caching_device: Optional device string or function describing where the
Variable should be cached for reading. Defaults to the Variable's
device. If not None
, caches on another device. Typical use is to
cache on the device where the Ops using the Variable reside, to
deduplicate copying through Switch
and other conditional statements.
partitioner: Optional callable that accepts a fully defined TensorShape
and dtype
of the Variable to be created, and returns a list of
partitions for each axis (currently only one axis can be partitioned).
validate_shape: If False, allows the variable to be initialized with a
value of unknown shape. If True, the default, the shape of initial_value
must be known.
custom_getter: Callable that takes as a first argument the true getter, and
allows overwriting the internal get_variable method.
The signature of custom_getter
should match that of this method,
but the most future-proof version will allow for changes:
def custom_getter(getter, *args, **kwargs)
. Direct access to
all get_variable
parameters is also allowed:
def custom_getter(getter, name, *args, **kwargs)
. A simple identity
custom getter that simply creates variables with modified names is:
python
def custom_getter(getter, name, *args, **kwargs):
return getter(name + '_suffix', *args, **kwargs)
Returns: The created or existing variable.
Raises:
ValueError: when creating a new variable and shape is not declared,
when violating reuse during variable creation, or when initializer
dtype
and dtype
don't match. Reuse is set inside variable_scope
.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def get_variable_scope(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.get_variable_scope, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.get_variable_scope
Return
Applicative
Origial documentation for Builder.get_variable_scope
def get_variable_scope(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.get_variable_scope
to work with tensorbuilder.core.builders.Builder
s. Instead of taking a Tensor as its first argument it takes a builder, the rest of the arguments are exactly the same.
Original Documentation for tf.get_variable_scope
def get_variable_scope()
Returns the current variable scope.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def get_variable_scope_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.get_variable_scope_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.get_variable_scope_layer
Return
Applicative
Origial documentation for Builder.get_variable_scope_layer
def get_variable_scope_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.get_variable_scope, ...)
Arguments
size
: the size of the resulting layer- All other *args and **kwargs are forwarded to
tf.contrib.layers.fully_connected
Return
Builder
Origial documentation for tf.get_variable_scope
def get_variable_scope():
Returns the current variable scope.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def global_norm(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.global_norm, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.global_norm
Return
Applicative
Origial documentation for Builder.global_norm
def global_norm(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.global_norm
to work with tensorbuilder.core.builders.Builder
s. Instead of taking a Tensor as its first argument it takes a builder, the rest of the arguments are exactly the same.
Original Documentation for tf.global_norm
def global_norm(t_list, name=None)
Computes the global norm of multiple tensors.
Given a tuple or list of tensors t_list
, this operation returns the
global norm of the elements in all tensors in t_list
. The global norm is
computed as:
global_norm = sqrt(sum([l2norm(t)**2 for t in t_list]))
Any entries in t_list
that are of type None are ignored.
Args:
t_list: A tuple or list of mixed Tensors
, IndexedSlices
, or None.
name: A name for the operation (optional).
Returns:
A 0-D (scalar) Tensor
of type float
.
Raises:
TypeError: If t_list
is not a sequence.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def global_norm_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.global_norm_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.global_norm_layer
Return
Applicative
Origial documentation for Builder.global_norm_layer
def global_norm_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.global_norm, ...)
Arguments
size
: the size of the resulting layer- All other *args and **kwargs are forwarded to
tf.contrib.layers.fully_connected
Return
Builder
Origial documentation for tf.global_norm
def global_norm(t_list, name=None):
Computes the global norm of multiple tensors.
Given a tuple or list of tensors t_list
, this operation returns the
global norm of the elements in all tensors in t_list
. The global norm is
computed as:
global_norm = sqrt(sum([l2norm(t)**2 for t in t_list]))
Any entries in t_list
that are of type None are ignored.
Args:
t_list: A tuple or list of mixed Tensors
, IndexedSlices
, or None.
name: A name for the operation (optional).
Returns:
A 0-D (scalar) Tensor
of type float
.
Raises:
TypeError: If t_list
is not a sequence.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def gradients(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.gradients, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.gradients
Return
Applicative
Origial documentation for Builder.gradients
def gradients(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.gradients
to work with tensorbuilder.core.builders.Builder
s. Instead of taking a Tensor as its first argument it takes a builder, the rest of the arguments are exactly the same.
Original Documentation for tf.gradients
def gradients(ys, xs, grad_ys=None, name="gradients", colocate_gradients_with_ops=False, gate_gradients=False, aggregation_method=None)
Constructs symbolic partial derivatives of sum of ys
w.r.t. x in xs
.
ys
and xs
are each a Tensor
or a list of tensors. grad_ys
is a list of Tensor
, holding the gradients received by the
ys
. The list must be the same length as ys
.
gradients()
adds ops to the graph to output the partial
derivatives of ys
with respect to xs
. It returns a list of
Tensor
of length len(xs)
where each tensor is the sum(dy/dx)
for y in ys
.
grad_ys
is a list of tensors of the same length as ys
that holds
the initial gradients for each y in ys
. When grad_ys
is None,
we fill in a tensor of '1's of the shape of y for each y in ys
. A
user can provide their own initial grad_ys
to compute the
derivatives using a different initial gradient for each y (e.g., if
one wanted to weight the gradient differently for each value in
each y).
Args:
ys: A Tensor
or list of tensors to be differentiated.
xs: A Tensor
or list of tensors to be used for differentiation.
grad_ys: Optional. A Tensor
or list of tensors the same size as
ys
and holding the gradients computed for each y in ys
.
name: Optional name to use for grouping all the gradient ops together.
defaults to 'gradients'.
colocate_gradients_with_ops: If True, try colocating gradients with
the corresponding op.
gate_gradients: If True, add a tuple around the gradients returned
for an operations. This avoids some race conditions.
aggregation_method: Specifies the method used to combine gradient terms.
Accepted values are constants defined in the class AggregationMethod
.
Returns:
A list of sum(dy/dx)
for each x in xs
.
Raises:
LookupError: if one of the operations between x
and y
does not
have a registered gradient function.
ValueError: if the arguments are invalid.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def gradients_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.gradients_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.gradients_layer
Return
Applicative
Origial documentation for Builder.gradients_layer
def gradients_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.gradients, ...)
Arguments
size
: the size of the resulting layer- All other *args and **kwargs are forwarded to
tf.contrib.layers.fully_connected
Return
Builder
Origial documentation for tf.gradients
def gradients(ys, xs, grad_ys=None, name="gradients", colocate_gradients_with_ops=False, gate_gradients=False, aggregation_method=None):
Constructs symbolic partial derivatives of sum of ys
w.r.t. x in xs
.
ys
and xs
are each a Tensor
or a list of tensors. grad_ys
is a list of Tensor
, holding the gradients received by the
ys
. The list must be the same length as ys
.
gradients()
adds ops to the graph to output the partial
derivatives of ys
with respect to xs
. It returns a list of
Tensor
of length len(xs)
where each tensor is the sum(dy/dx)
for y in ys
.
grad_ys
is a list of tensors of the same length as ys
that holds
the initial gradients for each y in ys
. When grad_ys
is None,
we fill in a tensor of '1's of the shape of y for each y in ys
. A
user can provide their own initial grad_ys
to compute the
derivatives using a different initial gradient for each y (e.g., if
one wanted to weight the gradient differently for each value in
each y).
Args:
ys: A Tensor
or list of tensors to be differentiated.
xs: A Tensor
or list of tensors to be used for differentiation.
grad_ys: Optional. A Tensor
or list of tensors the same size as
ys
and holding the gradients computed for each y in ys
.
name: Optional name to use for grouping all the gradient ops together.
defaults to 'gradients'.
colocate_gradients_with_ops: If True, try colocating gradients with
the corresponding op.
gate_gradients: If True, add a tuple around the gradients returned
for an operations. This avoids some race conditions.
aggregation_method: Specifies the method used to combine gradient terms.
Accepted values are constants defined in the class AggregationMethod
.
Returns:
A list of sum(dy/dx)
for each x in xs
.
Raises:
LookupError: if one of the operations between x
and y
does not
have a registered gradient function.
ValueError: if the arguments are invalid.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def greater(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.greater, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.greater
Return
Applicative
Origial documentation for Builder.greater
def greater(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.greater
to work with tensorbuilder.core.builders.Builder
s. Instead of taking a Tensor as its first argument it takes a builder, the rest of the arguments are exactly the same.
Original Documentation for tf.greater
def greater(x, y, name=None)
Returns the truth value of (x > y) element-wise.
NOTE: Greater
supports broadcasting. More about broadcasting
here
Args:
x: A Tensor
. Must be one of the following types: float32
, float64
, int32
, int64
, uint8
, int16
, int8
, uint16
, half
.
y: A Tensor
. Must have the same type as x
.
name: A name for the operation (optional).
Returns:
A Tensor
of type bool
.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def greater_equal(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.greater_equal, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.greater_equal
Return
Applicative
Origial documentation for Builder.greater_equal
def greater_equal(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.greater_equal
to work with tensorbuilder.core.builders.Builder
s. Instead of taking a Tensor as its first argument it takes a builder, the rest of the arguments are exactly the same.
Original Documentation for tf.greater_equal
def greater_equal(x, y, name=None)
Returns the truth value of (x >= y) element-wise.
NOTE: GreaterEqual
supports broadcasting. More about broadcasting
here
Args:
x: A Tensor
. Must be one of the following types: float32
, float64
, int32
, int64
, uint8
, int16
, int8
, uint16
, half
.
y: A Tensor
. Must have the same type as x
.
name: A name for the operation (optional).
Returns:
A Tensor
of type bool
.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def greater_equal_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.greater_equal_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.greater_equal_layer
Return
Applicative
Origial documentation for Builder.greater_equal_layer
def greater_equal_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.greater_equal, ...)
Arguments
size
: the size of the resulting layer- All other *args and **kwargs are forwarded to
tf.contrib.layers.fully_connected
Return
Builder
Origial documentation for tf.greater_equal
def greater_equal(x, y, name=None):
Returns the truth value of (x >= y) element-wise.
NOTE: GreaterEqual
supports broadcasting. More about broadcasting
here
Args:
x: A Tensor
. Must be one of the following types: float32
, float64
, int32
, int64
, uint8
, int16
, int8
, uint16
, half
.
y: A Tensor
. Must have the same type as x
.
name: A name for the operation (optional).
Returns:
A Tensor
of type bool
.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def greater_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.greater_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.greater_layer
Return
Applicative
Origial documentation for Builder.greater_layer
def greater_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.greater, ...)
Arguments
size
: the size of the resulting layer- All other *args and **kwargs are forwarded to
tf.contrib.layers.fully_connected
Return
Builder
Origial documentation for tf.greater
def greater(x, y, name=None):
Returns the truth value of (x > y) element-wise.
NOTE: Greater
supports broadcasting. More about broadcasting
here
Args:
x: A Tensor
. Must be one of the following types: float32
, float64
, int32
, int64
, uint8
, int16
, int8
, uint16
, half
.
y: A Tensor
. Must have the same type as x
.
name: A name for the operation (optional).
Returns:
A Tensor
of type bool
.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def group(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.group, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.group
Return
Applicative
Origial documentation for Builder.group
def group(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.group
to work with tensorbuilder.core.builders.Builder
s. Instead of taking a Tensor as its first argument it takes a builder, the rest of the arguments are exactly the same.
Original Documentation for tf.group
def group()
Create an op that groups multiple operations.
When this op finishes, all ops in input
have finished. This op has no
output.
See also tuple
and with_dependencies
.
Args: inputs: Zero or more tensors to group. *kwargs: Optional parameters to pass when constructing the NodeDef. name: A name for this operation (optional).
Returns: An Operation that executes all its inputs.
Raises: ValueError: If an unknown keyword argument is provided.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def group_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.group_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.group_layer
Return
Applicative
Origial documentation for Builder.group_layer
def group_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.group, ...)
Arguments
size
: the size of the resulting layer- All other *args and **kwargs are forwarded to
tf.contrib.layers.fully_connected
Return
Builder
Origial documentation for tf.group
def group():
Create an op that groups multiple operations.
When this op finishes, all ops in input
have finished. This op has no
output.
See also tuple
and with_dependencies
.
Args: inputs: Zero or more tensors to group. *kwargs: Optional parameters to pass when constructing the NodeDef. name: A name for this operation (optional).
Returns: An Operation that executes all its inputs.
Raises: ValueError: If an unknown keyword argument is provided.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def histogram_fixed_width(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.histogram_fixed_width, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.histogram_fixed_width
Return
Applicative
Origial documentation for Builder.histogram_fixed_width
def histogram_fixed_width(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.histogram_fixed_width
to work with tensorbuilder.core.builders.Builder
s. Instead of taking a Tensor as its first argument it takes a builder, the rest of the arguments are exactly the same.
Original Documentation for tf.histogram_fixed_width
def histogram_fixed_width(values, value_range, nbins=100, dtype=<dtype: 'int32'>, name=None)
Return histogram of values.
Given the tensor values
, this operation returns a rank 1 histogram counting
the number of entries in values
that fell into every bin. The bins are
equal width and determined by the arguments value_range
and nbins
.
Args:
values: Numeric Tensor
.
value_range: Shape [2] Tensor
. new_values <= value_range[0] will be
mapped to hist[0], values >= value_range[1] will be mapped to hist[-1].
Must be same dtype as new_values.
nbins: Scalar int32 Tensor
. Number of histogram bins.
dtype: dtype for returned histogram.
name: A name for this operation (defaults to 'histogram_fixed_width').
Returns:
A 1-D Tensor
holding histogram of values.
Examples:
```python
Bins will be: (-inf, 1), [1, 2), [2, 3), [3, 4), [4, inf)
nbins = 5 value_range = [0.0, 5.0] new_values = [-1.0, 0.0, 1.5, 2.0, 5.0, 15]
with tf.default_session() as sess: hist = tf.histogram_fixed_width(new_values, value_range, nbins=5) variables.initialize_all_variables().run() sess.run(hist) => [2, 1, 1, 0, 2] ```
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def histogram_fixed_width_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.histogram_fixed_width_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.histogram_fixed_width_layer
Return
Applicative
Origial documentation for Builder.histogram_fixed_width_layer
def histogram_fixed_width_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.histogram_fixed_width, ...)
Arguments
size
: the size of the resulting layer- All other *args and **kwargs are forwarded to
tf.contrib.layers.fully_connected
Return
Builder
Origial documentation for tf.histogram_fixed_width
def histogram_fixed_width(values, value_range, nbins=100, dtype=<dtype: 'int32'>, name=None):
Return histogram of values.
Given the tensor values
, this operation returns a rank 1 histogram counting
the number of entries in values
that fell into every bin. The bins are
equal width and determined by the arguments value_range
and nbins
.
Args:
values: Numeric Tensor
.
value_range: Shape [2] Tensor
. new_values <= value_range[0] will be
mapped to hist[0], values >= value_range[1] will be mapped to hist[-1].
Must be same dtype as new_values.
nbins: Scalar int32 Tensor
. Number of histogram bins.
dtype: dtype for returned histogram.
name: A name for this operation (defaults to 'histogram_fixed_width').
Returns:
A 1-D Tensor
holding histogram of values.
Examples:
```python
Bins will be: (-inf, 1), [1, 2), [2, 3), [3, 4), [4, inf)
nbins = 5 value_range = [0.0, 5.0] new_values = [-1.0, 0.0, 1.5, 2.0, 5.0, 15]
with tf.default_session() as sess: hist = tf.histogram_fixed_width(new_values, value_range, nbins=5) variables.initialize_all_variables().run() sess.run(hist) => [2, 1, 1, 0, 2] ```
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def histogram_summary(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.histogram_summary, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.histogram_summary
Return
Applicative
Origial documentation for Builder.histogram_summary
def histogram_summary(builder, tag):
THIS METHOD IS AUTOMATICALLY GENERATED
Same as tf.histogram_summary(tag, values, collections=None, name=None)
but the the with the summery tensor as its first parameter.
Return
Builder
Origial documentation for tf.histogram_summary
def histogram_summary(tag, values, collections=None, name=None):
Outputs a Summary
protocol buffer with a histogram.
The generated
Summary
has one summary value containing a histogram for values
.
This op reports an InvalidArgument
error if any value is not finite.
Args:
tag: A string
Tensor
. 0-D. Tag to use for the summary value.
values: A real numeric Tensor
. Any shape. Values to use to
build the histogram.
collections: Optional list of graph collections keys. The new summary op is
added to these collections. Defaults to [GraphKeys.SUMMARIES]
.
name: A name for the operation (optional).
Returns:
A scalar Tensor
of type string
. The serialized Summary
protocol
buffer.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def identity(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.identity, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.identity
Return
Applicative
Origial documentation for Builder.identity
def identity(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.identity
to work with tensorbuilder.core.builders.Builder
s. Instead of taking a Tensor as its first argument it takes a builder, the rest of the arguments are exactly the same.
Original Documentation for tf.identity
def identity(input, name=None)
Return a tensor with the same shape and contents as the input tensor or value.
Args:
input: A Tensor
.
name: A name for the operation (optional).
Returns:
A Tensor
. Has the same type as input
.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def identity_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.identity_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.identity_layer
Return
Applicative
Origial documentation for Builder.identity_layer
def identity_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.identity, ...)
Arguments
size
: the size of the resulting layer- All other *args and **kwargs are forwarded to
tf.contrib.layers.fully_connected
Return
Builder
Origial documentation for tf.identity
def identity(input, name=None):
Return a tensor with the same shape and contents as the input tensor or value.
Args:
input: A Tensor
.
name: A name for the operation (optional).
Returns:
A Tensor
. Has the same type as input
.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def ifft(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.ifft, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.ifft
Return
Applicative
Origial documentation for Builder.ifft
def ifft(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.ifft
to work with tensorbuilder.core.builders.Builder
s. Instead of taking a Tensor as its first argument it takes a builder, the rest of the arguments are exactly the same.
Original Documentation for tf.ifft
def ifft(input, name=None)
Compute the inverse 1-dimensional discrete Fourier Transform over the inner-most
dimension of input
.
Args:
input: A Tensor
of type complex64
. A complex64 tensor.
name: A name for the operation (optional).
Returns:
A Tensor
of type complex64
.
A complex64 tensor of the same shape as input
. The inner-most
dimension of input
is replaced with its inverse 1D Fourier Transform.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def ifft2d(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.ifft2d, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.ifft2d
Return
Applicative
Origial documentation for Builder.ifft2d
def ifft2d(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.ifft2d
to work with tensorbuilder.core.builders.Builder
s. Instead of taking a Tensor as its first argument it takes a builder, the rest of the arguments are exactly the same.
Original Documentation for tf.ifft2d
def ifft2d(input, name=None)
Compute the inverse 2-dimensional discrete Fourier Transform over the inner-most
2 dimensions of input
.
Args:
input: A Tensor
of type complex64
. A complex64 tensor.
name: A name for the operation (optional).
Returns:
A Tensor
of type complex64
.
A complex64 tensor of the same shape as input
. The inner-most 2
dimensions of input
are replaced with their inverse 2D Fourier Transform.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def ifft2d_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.ifft2d_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.ifft2d_layer
Return
Applicative
Origial documentation for Builder.ifft2d_layer
def ifft2d_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.ifft2d, ...)
Arguments
size
: the size of the resulting layer- All other *args and **kwargs are forwarded to
tf.contrib.layers.fully_connected
Return
Builder
Origial documentation for tf.ifft2d
def ifft2d(input, name=None):
Compute the inverse 2-dimensional discrete Fourier Transform over the inner-most
2 dimensions of input
.
Args:
input: A Tensor
of type complex64
. A complex64 tensor.
name: A name for the operation (optional).
Returns:
A Tensor
of type complex64
.
A complex64 tensor of the same shape as input
. The inner-most 2
dimensions of input
are replaced with their inverse 2D Fourier Transform.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def ifft3d(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.ifft3d, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.ifft3d
Return
Applicative