Origial documentation for Builder.ifft3d
def ifft3d(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.ifft3d
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.ifft3d
def ifft3d(input, name=None)
Compute the inverse 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 inverse 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 ifft3d_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.ifft3d_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.ifft3d_layer
Return
Applicative
Origial documentation for Builder.ifft3d_layer
def ifft3d_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.ifft3d, ...)
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.ifft3d
def ifft3d(input, name=None):
Compute the inverse 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 inverse 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 ifft_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.ifft_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.ifft_layer
Return
Applicative
Origial documentation for Builder.ifft_layer
def ifft_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.ifft, ...)
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.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 igamma(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.igamma, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.igamma
Return
Applicative
Origial documentation for Builder.igamma
def igamma(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.igamma
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.igamma
def igamma(a, x, name=None)
Compute the lower regularized incomplete Gamma function Q(a, x)
.
The lower regularized incomplete Gamma function is defined as:
P(a, x) = gamma(a, x) / Gamma(a) = 1 - Q(a, x)
where
gamma(a, x) = int_{0}^{x} t^{a-1} exp(-t) dt
is the lower incomplete Gamma function.
Note, above Q(a, x)
(Igammac
) is the upper regularized complete
Gamma function.
Args:
a: A Tensor
. Must be one of the following types: float32
, float64
.
x: A Tensor
. Must have the same type as a
.
name: A name for the operation (optional).
Returns:
A Tensor
. Has the same type as a
.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def igamma_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.igamma_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.igamma_layer
Return
Applicative
Origial documentation for Builder.igamma_layer
def igamma_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.igamma, ...)
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.igamma
def igamma(a, x, name=None):
Compute the lower regularized incomplete Gamma function Q(a, x)
.
The lower regularized incomplete Gamma function is defined as:
P(a, x) = gamma(a, x) / Gamma(a) = 1 - Q(a, x)
where
gamma(a, x) = int_{0}^{x} t^{a-1} exp(-t) dt
is the lower incomplete Gamma function.
Note, above Q(a, x)
(Igammac
) is the upper regularized complete
Gamma function.
Args:
a: A Tensor
. Must be one of the following types: float32
, float64
.
x: A Tensor
. Must have the same type as a
.
name: A name for the operation (optional).
Returns:
A Tensor
. Has the same type as a
.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def igammac(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.igammac, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.igammac
Return
Applicative
Origial documentation for Builder.igammac
def igammac(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.igammac
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.igammac
def igammac(a, x, name=None)
Compute the upper regularized incomplete Gamma function Q(a, x)
.
The upper regularized incomplete Gamma function is defined as:
Q(a, x) = Gamma(a, x) / Gamma(a) = 1 - P(a, x)
where
Gamma(a, x) = int_{x}^{\infty} t^{a-1} exp(-t) dt
is the upper incomplete Gama function.
Note, above P(a, x)
(Igamma
) is the lower regularized complete
Gamma function.
Args:
a: A Tensor
. Must be one of the following types: float32
, float64
.
x: A Tensor
. Must have the same type as a
.
name: A name for the operation (optional).
Returns:
A Tensor
. Has the same type as a
.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def igammac_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.igammac_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.igammac_layer
Return
Applicative
Origial documentation for Builder.igammac_layer
def igammac_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.igammac, ...)
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.igammac
def igammac(a, x, name=None):
Compute the upper regularized incomplete Gamma function Q(a, x)
.
The upper regularized incomplete Gamma function is defined as:
Q(a, x) = Gamma(a, x) / Gamma(a) = 1 - P(a, x)
where
Gamma(a, x) = int_{x}^{\infty} t^{a-1} exp(-t) dt
is the upper incomplete Gama function.
Note, above P(a, x)
(Igamma
) is the lower regularized complete
Gamma function.
Args:
a: A Tensor
. Must be one of the following types: float32
, float64
.
x: A Tensor
. Must have the same type as a
.
name: A name for the operation (optional).
Returns:
A Tensor
. Has the same type as a
.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def imag(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.imag, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.imag
Return
Applicative
Origial documentation for Builder.imag
def imag(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.imag
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.imag
def imag(input, name=None)
Returns the imaginary part of a complex number.
Given a tensor input
of complex numbers, this operation returns a tensor of
type float32
or float64
that is the imaginary part of each element in
input
. All elements in input
must be complex numbers of the form (a +
bj), where a is the real part and b is the imaginary part returned by
this operation.
For example:
```
tensor 'input' is [-2.25 + 4.75j, 3.25 + 5.75j]
tf.imag(input) ==> [4.75, 5.75] ```
Args:
input: A Tensor
. Must be one of the following types: complex64
, complex128
.
name: A name for the operation (optional).
Returns:
A Tensor
of type float32
or float64
.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def imag_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.imag_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.imag_layer
Return
Applicative
Origial documentation for Builder.imag_layer
def imag_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.imag, ...)
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.imag
def imag(input, name=None):
Returns the imaginary part of a complex number.
Given a tensor input
of complex numbers, this operation returns a tensor of
type float32
or float64
that is the imaginary part of each element in
input
. All elements in input
must be complex numbers of the form (a +
bj), where a is the real part and b is the imaginary part returned by
this operation.
For example:
```
tensor 'input' is [-2.25 + 4.75j, 3.25 + 5.75j]
tf.imag(input) ==> [4.75, 5.75] ```
Args:
input: A Tensor
. Must be one of the following types: complex64
, complex128
.
name: A name for the operation (optional).
Returns:
A Tensor
of type float32
or float64
.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def image_summary(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.image_summary, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.image_summary
Return
Applicative
Origial documentation for Builder.image_summary
def image_summary(builder, tag):
THIS METHOD IS AUTOMATICALLY GENERATED
Same as tf.image_summary(tag, tensor, max_images=3, collections=None, name=None)
but the the with the summery tensor as its first parameter.
Return
Builder
Origial documentation for tf.image_summary
def image_summary(tag, tensor, max_images=3, collections=None, name=None):
Outputs a Summary
protocol buffer with images.
The summary has up to max_images
summary values containing images. The
images are built from tensor
which must be 4-D with shape [batch_size,
height, width, channels]
and where channels
can be:
- 1:
tensor
is interpreted as Grayscale. - 3:
tensor
is interpreted as RGB. - 4:
tensor
is interpreted as RGBA.
The images have the same number of channels as the input tensor. For float
input, the values are normalized one image at a time to fit in the range
[0, 255]
. uint8
values are unchanged. The op uses two different
normalization algorithms:
-
If the input values are all positive, they are rescaled so the largest one is 255.
-
If any input value is negative, the values are shifted so input value 0.0 is at 127. They are then rescaled so that either the smallest value is 0, or the largest one is 255.
The tag
argument is a scalar Tensor
of type string
. It is used to
build the tag
of the summary values:
- If
max_images
is 1, the summary value tag is 'tag/image'. - If
max_images
is greater than 1, the summary value tags are generated sequentially as 'tag/image/0', 'tag/image/1', etc.
Args:
tag: A scalar Tensor
of type string
. Used to build the tag
of the summary values.
tensor: A 4-D uint8
or float32
Tensor
of shape [batch_size, height,
width, channels]
where channels
is 1, 3, or 4.
max_images: Max number of batch elements to generate images for.
collections: Optional list of ops.GraphKeys. The collections to add the
summary to. Defaults to [ops.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 import_graph_def(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.import_graph_def, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.import_graph_def
Return
Applicative
Origial documentation for Builder.import_graph_def
def import_graph_def(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.import_graph_def
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.import_graph_def
def import_graph_def(graph_def, input_map=None, return_elements=None, name=None, op_dict=None, producer_op_list=None)
Imports the TensorFlow graph in graph_def
into the Python Graph
.
This function provides a way to import a serialized TensorFlow
GraphDef
protocol buffer, and extract individual objects in the GraphDef
as
Tensor
and Operation
objects. See
Graph.as_graph_def()
for a way to create a
GraphDef
proto.
Args:
graph_def: A GraphDef
proto containing operations to be imported into
the default graph.
input_map: A dictionary mapping input names (as strings) in graph_def
to Tensor
objects. The values of the named input tensors in the
imported graph will be re-mapped to the respective Tensor
values.
return_elements: A list of strings containing operation names in
graph_def
that will be returned as Operation
objects; and/or
tensor names in graph_def
that will be returned as Tensor
objects.
name: (Optional.) A prefix that will be prepended to the names in
graph_def
. Defaults to "import"
.
op_dict: (Optional.) A dictionary mapping op type names to OpDef
protos.
Must contain an OpDef
proto for each op type named in graph_def
.
If omitted, uses the OpDef
protos registered in the global registry.
producer_op_list: (Optional.) An OpList
proto with the (possibly stripped)
list of OpDef
s used by the producer of the graph. If provided, attrs
for ops in graph_def
that are not in op_dict
that have their default
value according to producer_op_list
will be removed. This will allow
some more GraphDef
s produced by later binaries to be accepted by
earlier binaries.
Returns:
A list of Operation
and/or Tensor
objects from the imported graph,
corresponding to the names in return_elements
.
Raises:
TypeError: If graph_def
is not a GraphDef
proto,
input_map
is not a dictionary mapping strings to Tensor
objects,
or return_elements
is not a list of strings.
ValueError: If input_map
, or return_elements
contains names that
do not appear in graph_def
, or graph_def
is not well-formed (e.g.
it refers to an unknown tensor).
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def import_graph_def_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.import_graph_def_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.import_graph_def_layer
Return
Applicative
Origial documentation for Builder.import_graph_def_layer
def import_graph_def_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.import_graph_def, ...)
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.import_graph_def
def import_graph_def(graph_def, input_map=None, return_elements=None, name=None, op_dict=None, producer_op_list=None):
Imports the TensorFlow graph in graph_def
into the Python Graph
.
This function provides a way to import a serialized TensorFlow
GraphDef
protocol buffer, and extract individual objects in the GraphDef
as
Tensor
and Operation
objects. See
Graph.as_graph_def()
for a way to create a
GraphDef
proto.
Args:
graph_def: A GraphDef
proto containing operations to be imported into
the default graph.
input_map: A dictionary mapping input names (as strings) in graph_def
to Tensor
objects. The values of the named input tensors in the
imported graph will be re-mapped to the respective Tensor
values.
return_elements: A list of strings containing operation names in
graph_def
that will be returned as Operation
objects; and/or
tensor names in graph_def
that will be returned as Tensor
objects.
name: (Optional.) A prefix that will be prepended to the names in
graph_def
. Defaults to "import"
.
op_dict: (Optional.) A dictionary mapping op type names to OpDef
protos.
Must contain an OpDef
proto for each op type named in graph_def
.
If omitted, uses the OpDef
protos registered in the global registry.
producer_op_list: (Optional.) An OpList
proto with the (possibly stripped)
list of OpDef
s used by the producer of the graph. If provided, attrs
for ops in graph_def
that are not in op_dict
that have their default
value according to producer_op_list
will be removed. This will allow
some more GraphDef
s produced by later binaries to be accepted by
earlier binaries.
Returns:
A list of Operation
and/or Tensor
objects from the imported graph,
corresponding to the names in return_elements
.
Raises:
TypeError: If graph_def
is not a GraphDef
proto,
input_map
is not a dictionary mapping strings to Tensor
objects,
or return_elements
is not a list of strings.
ValueError: If input_map
, or return_elements
contains names that
do not appear in graph_def
, or graph_def
is not well-formed (e.g.
it refers to an unknown tensor).
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def in_top_k(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.in_top_k, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.in_top_k
Return
Applicative
Origial documentation for Builder.in_top_k
def in_top_k(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.nn.in_top_k
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.in_top_k
def in_top_k(predictions, targets, k, name=None)
Says whether the targets are in the top K
predictions.
This outputs a batch_size
bool array, an entry out[i]
is true
if the
prediction for the target class is among the top k
predictions among
all predictions for example i
. Note that the behavior of InTopK
differs
from the TopK
op in its handling of ties; if multiple classes have the
same prediction value and straddle the top-k
boundary, all of those
classes are considered to be in the top k
.
More formally, let
\(predictions_i\) be the predictions for all classes for example i
,
\(targets_i\) be the target class for example i
,
\(out_i\) be the output for example i
,
$$out_i = predictions_{i, targets_i} \in TopKIncludingTies(predictions_i)$$
Args:
predictions: A Tensor
of type float32
.
A batch_size
x classes
tensor.
targets: A Tensor
. Must be one of the following types: int32
, int64
.
A batch_size
vector of class ids.
k: An int
. Number of top elements to look at for computing precision.
name: A name for the operation (optional).
Returns:
A Tensor
of type bool
. Computed Precision at k
as a bool Tensor
.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def in_top_k_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.in_top_k_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.in_top_k_layer
Return
Applicative
Origial documentation for Builder.in_top_k_layer
def in_top_k_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.nn.in_top_k, ...)
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.in_top_k
def in_top_k(predictions, targets, k, name=None):
Says whether the targets are in the top K
predictions.
This outputs a batch_size
bool array, an entry out[i]
is true
if the
prediction for the target class is among the top k
predictions among
all predictions for example i
. Note that the behavior of InTopK
differs
from the TopK
op in its handling of ties; if multiple classes have the
same prediction value and straddle the top-k
boundary, all of those
classes are considered to be in the top k
.
More formally, let
\(predictions_i\) be the predictions for all classes for example i
,
\(targets_i\) be the target class for example i
,
\(out_i\) be the output for example i
,
$$out_i = predictions_{i, targets_i} \in TopKIncludingTies(predictions_i)$$
Args:
predictions: A Tensor
of type float32
.
A batch_size
x classes
tensor.
targets: A Tensor
. Must be one of the following types: int32
, int64
.
A batch_size
vector of class ids.
k: An int
. Number of top elements to look at for computing precision.
name: A name for the operation (optional).
Returns:
A Tensor
of type bool
. Computed Precision at k
as a bool Tensor
.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def initialize_all_tables(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.initialize_all_tables, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.initialize_all_tables
Return
Applicative
Origial documentation for Builder.initialize_all_tables
def initialize_all_tables(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.initialize_all_tables
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.initialize_all_tables
def initialize_all_tables(name="init_all_tables")
Returns an Op that initializes all tables of the default graph.
Args: name: Optional name for the initialization op.
Returns: An Op that initializes all tables. Note that if there are not tables the returned Op is a NoOp.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def initialize_all_tables_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.initialize_all_tables_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.initialize_all_tables_layer
Return
Applicative
Origial documentation for Builder.initialize_all_tables_layer
def initialize_all_tables_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.initialize_all_tables, ...)
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.initialize_all_tables
def initialize_all_tables(name="init_all_tables"):
Returns an Op that initializes all tables of the default graph.
Args: name: Optional name for the initialization op.
Returns: An Op that initializes all tables. Note that if there are not tables the returned Op is a NoOp.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def initialize_all_variables(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.initialize_all_variables, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.initialize_all_variables
Return
Applicative
Origial documentation for Builder.initialize_all_variables
def initialize_all_variables(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.initialize_all_variables
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.initialize_all_variables
def initialize_all_variables()
Returns an Op that initializes all variables.
This is just a shortcut for initialize_variables(all_variables())
Returns: An Op that initializes all variables in the graph.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def initialize_all_variables_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.initialize_all_variables_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.initialize_all_variables_layer
Return
Applicative
Origial documentation for Builder.initialize_all_variables_layer
def initialize_all_variables_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.initialize_all_variables, ...)
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.initialize_all_variables
def initialize_all_variables():
Returns an Op that initializes all variables.
This is just a shortcut for initialize_variables(all_variables())
Returns: An Op that initializes all variables in the graph.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def initialize_local_variables(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.initialize_local_variables, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.initialize_local_variables
Return
Applicative
Origial documentation for Builder.initialize_local_variables
def initialize_local_variables(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.initialize_local_variables
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.initialize_local_variables
def initialize_local_variables()
Returns an Op that initializes all local variables.
This is just a shortcut for initialize_variables(local_variables())
Returns: An Op that initializes all local variables in the graph.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def initialize_local_variables_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.initialize_local_variables_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.initialize_local_variables_layer
Return
Applicative
Origial documentation for Builder.initialize_local_variables_layer
def initialize_local_variables_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.initialize_local_variables, ...)
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.initialize_local_variables
def initialize_local_variables():
Returns an Op that initializes all local variables.
This is just a shortcut for initialize_variables(local_variables())
Returns: An Op that initializes all local variables in the graph.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def initialize_variables(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.initialize_variables, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.initialize_variables
Return
Applicative
Origial documentation for Builder.initialize_variables
def initialize_variables(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.initialize_variables
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.initialize_variables
def initialize_variables(var_list, name="init")
Returns an Op that initializes a list of variables.
After you launch the graph in a session, you can run the returned Op to
initialize all the variables in var_list
. This Op runs all the
initializers of the variables in var_list
in parallel.
Calling initialize_variables()
is equivalent to passing the list of
initializers to Group()
.
If var_list
is empty, however, the function still returns an Op that can
be run. That Op just has no effect.
Args:
var_list: List of Variable
objects to initialize.
name: Optional name for the returned operation.
Returns: An Op that run the initializers of all the specified variables.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def initialize_variables_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.initialize_variables_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.initialize_variables_layer
Return
Applicative
Origial documentation for Builder.initialize_variables_layer
def initialize_variables_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.initialize_variables, ...)
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.initialize_variables
def initialize_variables(var_list, name="init"):
Returns an Op that initializes a list of variables.
After you launch the graph in a session, you can run the returned Op to
initialize all the variables in var_list
. This Op runs all the
initializers of the variables in var_list
in parallel.
Calling initialize_variables()
is equivalent to passing the list of
initializers to Group()
.
If var_list
is empty, however, the function still returns an Op that can
be run. That Op just has no effect.
Args:
var_list: List of Variable
objects to initialize.
name: Optional name for the returned operation.
Returns: An Op that run the initializers of all the specified variables.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def inv(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.inv, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.inv
Return
Applicative
Origial documentation for Builder.inv
def inv(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.inv
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.inv
def inv(x, name=None)
Computes the reciprocal of x element-wise.
I.e., \(y = 1 / x\).
Args:
x: A Tensor
. Must be one of the following types: half
, float32
, float64
, int32
, int64
, complex64
, complex128
.
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 inv_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.inv_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.inv_layer
Return
Applicative
Origial documentation for Builder.inv_layer
def inv_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.inv, ...)
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.inv
def inv(x, name=None):
Computes the reciprocal of x element-wise.
I.e., \(y = 1 / x\).
Args:
x: A Tensor
. Must be one of the following types: half
, float32
, float64
, int32
, int64
, complex64
, complex128
.
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 invert_permutation(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.invert_permutation, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.invert_permutation
Return
Applicative
Origial documentation for Builder.invert_permutation
def invert_permutation(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.invert_permutation
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.invert_permutation
def invert_permutation(x, name=None)
Computes the inverse permutation of a tensor.
This operation computes the inverse of an index permutation. It takes a 1-D
integer tensor x
, which represents the indices of a zero-based array, and
swaps each value with its index position. In other words, for an output tensor
y
and an input tensor x
, this operation computes the following:
y[x[i]] = i for i in [0, 1, ..., len(x) - 1]
The values must include 0. There can be no duplicate values or negative values.
For example:
```prettyprint
tensor x
is [3, 4, 0, 2, 1]
invert_permutation(x) ==> [2, 4, 3, 0, 1] ```
Args:
x: A Tensor
. Must be one of the following types: int32
, int64
. 1-D.
name: A name for the operation (optional).
Returns:
A Tensor
. Has the same type as x
. 1-D.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def invert_permutation_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.invert_permutation_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.invert_permutation_layer
Return
Applicative
Origial documentation for Builder.invert_permutation_layer
def invert_permutation_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.invert_permutation, ...)
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.invert_permutation
def invert_permutation(x, name=None):
Computes the inverse permutation of a tensor.
This operation computes the inverse of an index permutation. It takes a 1-D
integer tensor x
, which represents the indices of a zero-based array, and
swaps each value with its index position. In other words, for an output tensor
y
and an input tensor x
, this operation computes the following:
y[x[i]] = i for i in [0, 1, ..., len(x) - 1]
The values must include 0. There can be no duplicate values or negative values.
For example:
```prettyprint
tensor x
is [3, 4, 0, 2, 1]
invert_permutation(x) ==> [2, 4, 3, 0, 1] ```
Args:
x: A Tensor
. Must be one of the following types: int32
, int64
. 1-D.
name: A name for the operation (optional).
Returns:
A Tensor
. Has the same type as x
. 1-D.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def is_finite(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.is_finite, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.is_finite
Return
Applicative
Origial documentation for Builder.is_finite
def is_finite(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.is_finite
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.is_finite
def is_finite(x, name=None)
Returns which elements of x are finite.
Args:
x: A Tensor
. Must be one of the following types: half
, float32
, float64
.
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 is_finite_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.is_finite_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.is_finite_layer
Return
Applicative
Origial documentation for Builder.is_finite_layer
def is_finite_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.is_finite, ...)
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.is_finite
def is_finite(x, name=None):
Returns which elements of x are finite.
Args:
x: A Tensor
. Must be one of the following types: half
, float32
, float64
.
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 is_inf(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.is_inf, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.is_inf
Return
Applicative
Origial documentation for Builder.is_inf
def is_inf(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.is_inf
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.is_inf
def is_inf(x, name=None)
Returns which elements of x are Inf.
Args:
x: A Tensor
. Must be one of the following types: half
, float32
, float64
.
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 is_inf_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.is_inf_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.is_inf_layer
Return
Applicative
Origial documentation for Builder.is_inf_layer
def is_inf_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.is_inf, ...)
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.is_inf
def is_inf(x, name=None):
Returns which elements of x are Inf.
Args:
x: A Tensor
. Must be one of the following types: half
, float32
, float64
.
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 is_nan(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.is_nan, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.is_nan
Return
Applicative
Origial documentation for Builder.is_nan
def is_nan(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.is_nan
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.is_nan
def is_nan(x, name=None)
Returns which elements of x are NaN.
Args:
x: A Tensor
. Must be one of the following types: half
, float32
, float64
.
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 is_nan_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.is_nan_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.is_nan_layer
Return
Applicative
Origial documentation for Builder.is_nan_layer
def is_nan_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.is_nan, ...)
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.is_nan
def is_nan(x, name=None):
Returns which elements of x are NaN.
Args:
x: A Tensor
. Must be one of the following types: half
, float32
, float64
.
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 is_non_decreasing(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.is_non_decreasing, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.is_non_decreasing
Return
Applicative
Origial documentation for Builder.is_non_decreasing
def is_non_decreasing(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.is_non_decreasing
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.is_non_decreasing
def is_non_decreasing(x, name=None)
Returns True
if x
is non-decreasing.
Elements of x
are compared in row-major order. The tensor [x[0],...]
is non-decreasing if for every adjacent pair we have x[i] <= x[i+1]
.
If x
has less than two elements, it is trivially non-decreasing.
See also: is_strictly_increasing
Args:
x: Numeric Tensor
.
name: A name for this operation (optional). Defaults to "is_non_decreasing"
Returns:
Boolean Tensor
, equal to True
iff x
is non-decreasing.
Raises:
TypeError: if x
is not a numeric tensor.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def is_non_decreasing_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.is_non_decreasing_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.is_non_decreasing_layer
Return
Applicative
Origial documentation for Builder.is_non_decreasing_layer
def is_non_decreasing_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.is_non_decreasing, ...)
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.is_non_decreasing
def is_non_decreasing(x, name=None):
Returns True
if x
is non-decreasing.
Elements of x
are compared in row-major order. The tensor [x[0],...]
is non-decreasing if for every adjacent pair we have x[i] <= x[i+1]
.
If x
has less than two elements, it is trivially non-decreasing.
See also: is_strictly_increasing
Args:
x: Numeric Tensor
.
name: A name for this operation (optional). Defaults to "is_non_decreasing"
Returns:
Boolean Tensor
, equal to True
iff x
is non-decreasing.
Raises:
TypeError: if x
is not a numeric tensor.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def is_numeric_tensor(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.is_numeric_tensor, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.is_numeric_tensor
Return
Applicative
Origial documentation for Builder.is_numeric_tensor
def is_numeric_tensor(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.is_numeric_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.is_numeric_tensor
def is_numeric_tensor(tensor)
None
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def is_numeric_tensor_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.is_numeric_tensor_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.is_numeric_tensor_layer
Return
Applicative
Origial documentation for Builder.is_numeric_tensor_layer
def is_numeric_tensor_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.is_numeric_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.is_numeric_tensor
def is_numeric_tensor(tensor):
None
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def is_strictly_increasing(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.is_strictly_increasing, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.is_strictly_increasing
Return
Applicative
Origial documentation for Builder.is_strictly_increasing
def is_strictly_increasing(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.is_strictly_increasing
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.is_strictly_increasing
def is_strictly_increasing(x, name=None)
Returns True
if x
is strictly increasing.
Elements of x
are compared in row-major order. The tensor [x[0],...]
is strictly increasing if for every adjacent pair we have x[i] < x[i+1]
.
If x
has less than two elements, it is trivially strictly increasing.
See also: is_non_decreasing
Args:
x: Numeric Tensor
.
name: A name for this operation (optional).
Defaults to "is_strictly_increasing"
Returns:
Boolean Tensor
, equal to True
iff x
is strictly increasing.
Raises:
TypeError: if x
is not a numeric tensor.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def is_strictly_increasing_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.is_strictly_increasing_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.is_strictly_increasing_layer
Return
Applicative
Origial documentation for Builder.is_strictly_increasing_layer
def is_strictly_increasing_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.is_strictly_increasing, ...)
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.is_strictly_increasing
def is_strictly_increasing(x, name=None):
Returns True
if x
is strictly increasing.
Elements of x
are compared in row-major order. The tensor [x[0],...]
is strictly increasing if for every adjacent pair we have x[i] < x[i+1]
.
If x
has less than two elements, it is trivially strictly increasing.
See also: is_non_decreasing
Args:
x: Numeric Tensor
.
name: A name for this operation (optional).
Defaults to "is_strictly_increasing"
Returns:
Boolean Tensor
, equal to True
iff x
is strictly increasing.
Raises:
TypeError: if x
is not a numeric tensor.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def is_variable_initialized(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.is_variable_initialized, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.is_variable_initialized
Return
Applicative
Origial documentation for Builder.is_variable_initialized
def is_variable_initialized(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.is_variable_initialized
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.is_variable_initialized
def is_variable_initialized(variable)
Tests if a variable has been initialized.
Args:
variable: A Variable
.
Returns:
Returns a scalar boolean Tensor, True
if the variable has been
initialized, False
otherwise.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def is_variable_initialized_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.is_variable_initialized_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.is_variable_initialized_layer
Return
Applicative
Origial documentation for Builder.is_variable_initialized_layer
def is_variable_initialized_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.is_variable_initialized, ...)
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.is_variable_initialized
def is_variable_initialized(variable):
Tests if a variable has been initialized.
Args:
variable: A Variable
.
Returns:
Returns a scalar boolean Tensor, True
if the variable has been
initialized, False
otherwise.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def l2_loss(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.l2_loss, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.l2_loss
Return
Applicative
Origial documentation for Builder.l2_loss
def l2_loss(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.nn.l2_loss
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.l2_loss
def l2_loss(t, name=None)
L2 Loss.
Computes half the L2 norm of a tensor without the sqrt
:
output = sum(t ** 2) / 2
Args:
t: A Tensor
. Must be one of the following types: float32
, float64
, int64
, int32
, uint8
, uint16
, int16
, int8
, complex64
, complex128
, qint8
, quint8
, qint32
, half
.
Typically 2-D, but may have any dimensions.
name: A name for the operation (optional).
Returns:
A Tensor
. Has the same type as t
. 0-D.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def l2_loss_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.l2_loss_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.l2_loss_layer
Return
Applicative
Origial documentation for Builder.l2_loss_layer
def l2_loss_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.nn.l2_loss, ...)
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.l2_loss
def l2_loss(t, name=None):
L2 Loss.
Computes half the L2 norm of a tensor without the sqrt
:
output = sum(t ** 2) / 2
Args:
t: A Tensor
. Must be one of the following types: float32
, float64
, int64
, int32
, uint8
, uint16
, int16
, int8
, complex64
, complex128
, qint8
, quint8
, qint32
, half
.
Typically 2-D, but may have any dimensions.
name: A name for the operation (optional).
Returns:
A Tensor
. Has the same type as t
. 0-D.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def l2_normalize(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.l2_normalize, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.l2_normalize
Return
Applicative
Origial documentation for Builder.l2_normalize
def l2_normalize(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.nn.l2_normalize
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.l2_normalize
def l2_normalize(x, dim, epsilon=1e-12, name=None)
Normalizes along dimension dim
using an L2 norm.
For a 1-D tensor with dim = 0
, computes
output = x / sqrt(max(sum(x**2), epsilon))
For x
with more dimensions, independently normalizes each 1-D slice along
dimension dim
.
Args:
x: A Tensor
.
dim: Dimension along which to normalize. A scalar or a vector of
integers.
epsilon: A lower bound value for the norm. Will use sqrt(epsilon)
as the
divisor if norm < sqrt(epsilon)
.
name: A name for this operation (optional).
Returns:
A Tensor
with the same shape as x
.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def l2_normalize_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.l2_normalize_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.l2_normalize_layer
Return
Applicative
Origial documentation for Builder.l2_normalize_layer
def l2_normalize_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.nn.l2_normalize, ...)
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.l2_normalize
def l2_normalize(x, dim, epsilon=1e-12, name=None):
Normalizes along dimension dim
using an L2 norm.
For a 1-D tensor with dim = 0
, computes
output = x / sqrt(max(sum(x**2), epsilon))
For x
with more dimensions, independently normalizes each 1-D slice along
dimension dim
.
Args:
x: A Tensor
.
dim: Dimension along which to normalize. A scalar or a vector of
integers.
epsilon: A lower bound value for the norm. Will use sqrt(epsilon)
as the
divisor if norm < sqrt(epsilon)
.
name: A name for this operation (optional).
Returns:
A Tensor
with the same shape as x
.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def lbeta(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.lbeta, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.lbeta
Return
Applicative
Origial documentation for Builder.lbeta
def lbeta(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.lbeta
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.lbeta
def lbeta(x, name="lbeta")
Computes ln(|Beta(x)|)
, reducing along the last dimension.
Given one-dimensional z = [z_0,...,z_{K-1}]
, we define
Beta(z) = \prod_j Gamma(z_j) / Gamma(\sum_j z_j)
And for n + 1
dimensional x
with shape [N1, ..., Nn, K]
, we define
lbeta(x)[i1, ..., in] = Log(|Beta(x[i1, ..., in, :])|)
. In other words,
the last dimension is treated as the z
vector.
Note that if z = [u, v]
, then
Beta(z) = int_0^1 t^{u-1} (1 - t)^{v-1} dt
, which defines the traditional
bivariate beta function.
Args:
x: A rank n + 1
Tensor
with type float
, or double
.
name: A name for the operation (optional).
Returns:
The logarithm of |Beta(x)|
reducing along the last dimension.
Raises:
ValueError: If x
is empty with rank one or less.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def lbeta_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.lbeta_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.lbeta_layer
Return
Applicative
Origial documentation for Builder.lbeta_layer
def lbeta_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.lbeta, ...)
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.lbeta
def lbeta(x, name="lbeta"):
Computes ln(|Beta(x)|)
, reducing along the last dimension.
Given one-dimensional z = [z_0,...,z_{K-1}]
, we define
Beta(z) = \prod_j Gamma(z_j) / Gamma(\sum_j z_j)
And for n + 1
dimensional x
with shape [N1, ..., Nn, K]
, we define
lbeta(x)[i1, ..., in] = Log(|Beta(x[i1, ..., in, :])|)
. In other words,
the last dimension is treated as the z
vector.
Note that if z = [u, v]
, then
Beta(z) = int_0^1 t^{u-1} (1 - t)^{v-1} dt
, which defines the traditional
bivariate beta function.
Args:
x: A rank n + 1
Tensor
with type float
, or double
.
name: A name for the operation (optional).
Returns:
The logarithm of |Beta(x)|
reducing along the last dimension.
Raises:
ValueError: If x
is empty with rank one or less.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def learned_unigram_candidate_sampler(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.learned_unigram_candidate_sampler, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.learned_unigram_candidate_sampler
Return
Applicative
Origial documentation for Builder.learned_unigram_candidate_sampler
def learned_unigram_candidate_sampler(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.nn.learned_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.learned_unigram_candidate_sampler
def learned_unigram_candidate_sampler(true_classes, num_true, num_sampled, unique, range_max, seed=None, name=None)
Samples a set of classes from a distribution learned during training.
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 for this operation is constructed on the fly
during training. It is a unigram distribution over the target
classes seen so far during training. Every integer in [0, range_max)
begins with a weight of 1, and is incremented by 1 each time it is
seen as a target class. The base distribution is not saved to checkpoints,
so it is reset when the model is reloaded.
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.
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 learned_unigram_candidate_sampler_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.learned_unigram_candidate_sampler_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.learned_unigram_candidate_sampler_layer
Return
Applicative
Origial documentation for Builder.learned_unigram_candidate_sampler_layer
def learned_unigram_candidate_sampler_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.nn.learned_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.learned_unigram_candidate_sampler
def learned_unigram_candidate_sampler(true_classes, num_true, num_sampled, unique, range_max, seed=None, name=None):
Samples a set of classes from a distribution learned during training.
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 for this operation is constructed on the fly
during training. It is a unigram distribution over the target
classes seen so far during training. Every integer in [0, range_max)
begins with a weight of 1, and is incremented by 1 each time it is
seen as a target class. The base distribution is not saved to checkpoints,
so it is reset when the model is reloaded.
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.
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 less(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.less, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.less
Return
Applicative
Origial documentation for Builder.less
def less(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.less
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.less
def less(x, y, name=None)
Returns the truth value of (x < y) element-wise.
NOTE: Less
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 less_equal(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.less_equal, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.less_equal
Return
Applicative
Origial documentation for Builder.less_equal
def less_equal(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.less_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.less_equal
def less_equal(x, y, name=None)
Returns the truth value of (x <= y) element-wise.
NOTE: LessEqual
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 less_equal_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.less_equal_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.less_equal_layer
Return
Applicative
Origial documentation for Builder.less_equal_layer
def less_equal_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.less_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.less_equal
def less_equal(x, y, name=None):
Returns the truth value of (x <= y) element-wise.
NOTE: LessEqual
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 less_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.less_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.less_layer
Return
Applicative
Origial documentation for Builder.less_layer
def less_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.less, ...)
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.less
def less(x, y, name=None):
Returns the truth value of (x < y) element-wise.
NOTE: Less
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 lgamma(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.lgamma, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.lgamma
Return
Applicative
Origial documentation for Builder.lgamma
def lgamma(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.lgamma
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.lgamma
def lgamma(x, name=None)
Computes the log of the absolute value of Gamma(x)
element-wise.
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 lgamma_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.lgamma_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.lgamma_layer
Return
Applicative
Origial documentation for Builder.lgamma_layer
def lgamma_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.lgamma, ...)
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.lgamma
def lgamma(x, name=None):
Computes the log of the absolute value of Gamma(x)
element-wise.
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 lin_space(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.lin_space, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.lin_space
Return
Applicative
Origial documentation for Builder.lin_space
def lin_space(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.lin_space
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.lin_space
def lin_space(start, stop, num, name=None)
Generates values in an interval.
A sequence of num
evenly-spaced values are generated beginning at start
.
If num > 1
, the values in the sequence increase by stop - start / num - 1
,
so that the last one is exactly stop
.
For example:
tf.linspace(10.0, 12.0, 3, name="linspace") => [ 10.0 11.0 12.0]
Args:
start: A Tensor
. Must be one of the following types: float32
, float64
.
First entry in the range.
stop: A Tensor
. Must have the same type as start
.
Last entry in the range.
num: A Tensor
. Must be one of the following types: int32
, int64
.
Number of values to generate.
name: A name for the operation (optional).
Returns:
A Tensor
. Has the same type as start
. 1-D. The generated values.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def lin_space_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.lin_space_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.lin_space_layer
Return
Applicative
Origial documentation for Builder.lin_space_layer
def lin_space_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.lin_space, ...)
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.lin_space
def lin_space(start, stop, num, name=None):
Generates values in an interval.
A sequence of num
evenly-spaced values are generated beginning at start
.
If num > 1
, the values in the sequence increase by stop - start / num - 1
,
so that the last one is exactly stop
.
For example:
tf.linspace(10.0, 12.0, 3, name="linspace") => [ 10.0 11.0 12.0]
Args:
start: A Tensor
. Must be one of the following types: float32
, float64
.
First entry in the range.
stop: A Tensor
. Must have the same type as start
.
Last entry in the range.
num: A Tensor
. Must be one of the following types: int32
, int64
.
Number of values to generate.
name: A name for the operation (optional).
Returns:
A Tensor
. Has the same type as start
. 1-D. The generated values.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def linear_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.linear_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.linear_layer
Return
Applicative
Origial documentation for Builder.linear_layer
def linear_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method the same as tensorbuilder.linear_layer
.
Original Documentation for tensorbuilder.linear_layer
def linear_layer(builder, size)
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method the same as tensorbuilder.linear_layer
.
Original Documentation for tensorbuilder.linear_layer
def linear_layer(builder, size)
Alias for .fully_connected(size, activation_fn = None, ...)
Arguments
size
: the size of the resulting layer- All other *args and **kwargs are forwarded to
tf.contrib.layers.fully_connected
Return
Builder
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def linspace_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.linspace_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.linspace_layer
Return
Applicative
Origial documentation for Builder.linspace_layer
def linspace_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.linspace, ...)
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.linspace
def lin_space(start, stop, num, name=None):
Generates values in an interval.
A sequence of num
evenly-spaced values are generated beginning at start
.
If num > 1
, the values in the sequence increase by stop - start / num - 1
,
so that the last one is exactly stop
.
For example:
tf.linspace(10.0, 12.0, 3, name="linspace") => [ 10.0 11.0 12.0]
Args:
start: A Tensor
. Must be one of the following types: float32
, float64
.
First entry in the range.
stop: A Tensor
. Must have the same type as start
.
Last entry in the range.
num: A Tensor
. Must be one of the following types: int32
, int64
.
Number of values to generate.
name: A name for the operation (optional).
Returns:
A Tensor
. Has the same type as start
. 1-D. The generated values.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def list_diff(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.list_diff, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.list_diff
Return
Applicative
Origial documentation for Builder.list_diff
def list_diff(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.list_diff
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.list_diff
def list_diff(x, y, out_idx=None, name=None)
Computes the difference between two lists of numbers or strings.
Given a list x
and a list y
, this operation returns a list out
that
represents all values that are in x
but not in y
. The returned list out
is sorted in the same order that the numbers appear in x
(duplicates are
preserved). This operation also returns a list idx
that represents the
position of each out
element in x
. In other words:
out[i] = x[idx[i]] for i in [0, 1, ..., len(out) - 1]
For example, given this input:
prettyprint
x = [1, 2, 3, 4, 5, 6]
y = [1, 3, 5]
This operation would return:
prettyprint
out ==> [2, 4, 6]
idx ==> [1, 3, 5]
Args:
x: A Tensor
. 1-D. Values to keep.
y: A Tensor
. Must have the same type as x
. 1-D. Values to remove.
out_idx: An optional tf.DType
from: tf.int32, tf.int64
. Defaults to tf.int32
.
name: A name for the operation (optional).
Returns:
A tuple of Tensor
objects (out, idx).
out: A Tensor
. Has the same type as x
. 1-D. Values present in x
but not in y
.
idx: A Tensor
of type out_idx
. 1-D. Positions of x
values preserved in out
.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def list_diff_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.list_diff_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.list_diff_layer
Return
Applicative
Origial documentation for Builder.list_diff_layer
def list_diff_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.list_diff, ...)
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.list_diff
def list_diff(x, y, out_idx=None, name=None):
Computes the difference between two lists of numbers or strings.
Given a list x
and a list y
, this operation returns a list out
that
represents all values that are in x
but not in y
. The returned list out
is sorted in the same order that the numbers appear in x
(duplicates are
preserved). This operation also returns a list idx
that represents the
position of each out
element in x
. In other words:
out[i] = x[idx[i]] for i in [0, 1, ..., len(out) - 1]
For example, given this input:
prettyprint
x = [1, 2, 3, 4, 5, 6]
y = [1, 3, 5]
This operation would return:
prettyprint
out ==> [2, 4, 6]
idx ==> [1, 3, 5]
Args:
x: A Tensor
. 1-D. Values to keep.
y: A Tensor
. Must have the same type as x
. 1-D. Values to remove.
out_idx: An optional tf.DType
from: tf.int32, tf.int64
. Defaults to tf.int32
.
name: A name for the operation (optional).
Returns:
A tuple of Tensor
objects (out, idx).
out: A Tensor
. Has the same type as x
. 1-D. Values present in x
but not in y
.
idx: A Tensor
of type out_idx
. 1-D. Positions of x
values preserved in out
.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def listdiff_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.listdiff_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.listdiff_layer
Return
Applicative
Origial documentation for Builder.listdiff_layer
def listdiff_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.listdiff, ...)
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.listdiff
def list_diff(x, y, out_idx=None, name=None):
Computes the difference between two lists of numbers or strings.
Given a list x
and a list y
, this operation returns a list out
that
represents all values that are in x
but not in y
. The returned list out
is sorted in the same order that the numbers appear in x
(duplicates are
preserved). This operation also returns a list idx
that represents the
position of each out
element in x
. In other words:
out[i] = x[idx[i]] for i in [0, 1, ..., len(out) - 1]
For example, given this input:
prettyprint
x = [1, 2, 3, 4, 5, 6]
y = [1, 3, 5]
This operation would return:
prettyprint
out ==> [2, 4, 6]
idx ==> [1, 3, 5]
Args:
x: A Tensor
. 1-D. Values to keep.
y: A Tensor
. Must have the same type as x
. 1-D. Values to remove.
out_idx: An optional tf.DType
from: tf.int32, tf.int64
. Defaults to tf.int32
.
name: A name for the operation (optional).
Returns:
A tuple of Tensor
objects (out, idx).
out: A Tensor
. Has the same type as x
. 1-D. Values present in x
but not in y
.
idx: A Tensor
of type out_idx
. 1-D. Positions of x
values preserved in out
.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def load_file_system_library(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.load_file_system_library, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.load_file_system_library
Return
Applicative
Origial documentation for Builder.load_file_system_library
def load_file_system_library(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.load_file_system_library
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.load_file_system_library
def load_file_system_library(library_filename)
Loads a TensorFlow plugin, containing file system implementation.
Pass library_filename
to a platform-specific mechanism for dynamically
loading a library. The rules for determining the exact location of the
library are platform-specific and are not documented here.
Args: library_filename: Path to the plugin. Relative or absolute filesystem path to a dynamic library file.
Returns: None.
Raises: RuntimeError: when unable to load the library.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def load_file_system_library_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.load_file_system_library_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.load_file_system_library_layer
Return
Applicative
Origial documentation for Builder.load_file_system_library_layer
def load_file_system_library_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.load_file_system_library, ...)
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.load_file_system_library
def load_file_system_library(library_filename):
Loads a TensorFlow plugin, containing file system implementation.
Pass library_filename
to a platform-specific mechanism for dynamically
loading a library. The rules for determining the exact location of the
library are platform-specific and are not documented here.
Args: library_filename: Path to the plugin. Relative or absolute filesystem path to a dynamic library file.
Returns: None.
Raises: RuntimeError: when unable to load the library.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def load_op_library(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.load_op_library, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.load_op_library
Return
Applicative
Origial documentation for Builder.load_op_library
def load_op_library(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.load_op_library
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.load_op_library
def load_op_library(library_filename)
Loads a TensorFlow plugin, containing custom ops and kernels.
Pass "library_filename" to a platform-specific mechanism for dynamically loading a library. The rules for determining the exact location of the library are platform-specific and are not documented here. When the library is loaded, ops and kernels registered in the library via the REGISTER_* macros are made available in the TensorFlow process. Note that ops with the same name as an existing op are rejected and not registered with the process.
Args: library_filename: Path to the plugin. Relative or absolute filesystem path to a dynamic library file.
Returns: A python module containing the Python wrappers for Ops defined in the plugin.
Raises: RuntimeError: when unable to load the library or get the python wrappers.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def load_op_library_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.load_op_library_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.load_op_library_layer
Return
Applicative
Origial documentation for Builder.load_op_library_layer
def load_op_library_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.load_op_library, ...)
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.load_op_library
def load_op_library(library_filename):
Loads a TensorFlow plugin, containing custom ops and kernels.
Pass "library_filename" to a platform-specific mechanism for dynamically loading a library. The rules for determining the exact location of the library are platform-specific and are not documented here. When the library is loaded, ops and kernels registered in the library via the REGISTER_* macros are made available in the TensorFlow process. Note that ops with the same name as an existing op are rejected and not registered with the process.
Args: library_filename: Path to the plugin. Relative or absolute filesystem path to a dynamic library file.
Returns: A python module containing the Python wrappers for Ops defined in the plugin.
Raises: RuntimeError: when unable to load the library or get the python wrappers.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def local_response_normalization_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.local_response_normalization_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.local_response_normalization_layer
Return
Applicative
Origial documentation for Builder.local_response_normalization_layer
def local_response_normalization_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.nn.local_response_normalization, ...)
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.local_response_normalization
def lrn(input, depth_radius=None, bias=None, alpha=None, beta=None, name=None):
Local Response Normalization.
The 4-D input
tensor is treated as a 3-D array of 1-D vectors (along the last
dimension), and each vector is normalized independently. Within a given vector,
each component is divided by the weighted, squared sum of inputs within
depth_radius
. In detail,
sqr_sum[a, b, c, d] = sum(input[a, b, c, d - depth_radius : d + depth_radius + 1] ** 2) output = input / (bias + alpha * sqr_sum) ** beta
For details, see [Krizhevsky et al., ImageNet classification with deep convolutional neural networks (NIPS 2012)] (http://papers.nips.cc/paper/4824-imagenet-classification-with-deep-convolutional-neural-networks).
Args:
input: A Tensor
. Must be one of the following types: float32
, half
.
4-D.
depth_radius: An optional int
. Defaults to 5
.
0-D. Half-width of the 1-D normalization window.
bias: An optional float
. Defaults to 1
.
An offset (usually positive to avoid dividing by 0).
alpha: An optional float
. Defaults to 1
.
A scale factor, usually positive.
beta: An optional float
. Defaults to 0.5
. An exponent.
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 local_variables(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.local_variables, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.local_variables
Return
Applicative
Origial documentation for Builder.local_variables
def local_variables(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.local_variables
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.local_variables
def local_variables()
Returns all variables created with collection=[LOCAL_VARIABLES].
Returns: A list of local Variable objects.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def local_variables_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.local_variables_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.local_variables_layer
Return
Applicative
Origial documentation for Builder.local_variables_layer
def local_variables_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.local_variables, ...)
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.local_variables
def local_variables():
Returns all variables created with collection=[LOCAL_VARIABLES].
Returns: A list of local Variable objects.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def log(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.log, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.log
Return
Applicative
Origial documentation for Builder.log
def log(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.log
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.log
def log(x, name=None)
Computes natural logarithm of x element-wise.
I.e., \(y = \log_e x\).
Args:
x: A Tensor
. Must be one of the following types: half
, float32
, float64
, complex64
, complex128
.
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 log_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.log_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.log_layer
Return
Applicative
Origial documentation for Builder.log_layer
def log_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.log, ...)
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.log
def log(x, name=None):
Computes natural logarithm of x element-wise.
I.e., \(y = \log_e x\).
Args:
x: A Tensor
. Must be one of the following types: half
, float32
, float64
, complex64
, complex128
.
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 log_poisson_loss(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.log_poisson_loss, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.log_poisson_loss
Return
Applicative
Origial documentation for Builder.log_poisson_loss
def log_poisson_loss(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.nn.log_poisson_loss
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.log_poisson_loss
def log_poisson_loss(log_input, targets, compute_full_loss=False, name=None)
Computes log poisson loss given log_input
.
Gives the log-likelihood loss between the prediction and the target under the assumption that the target has a poisson distribution. Caveat: By default, this is not the exact loss, but the loss minus a constant term [log(z!)]. That has no effect for optimization, but does not play well with relative loss comparisons. To compute an approximation of the log factorial term, specify compute_full_loss=True to enable Stirling's Approximation.
For brevity, let c = log(x) = log_input
, z = targets
. The log poisson
loss is
-log(exp(-x) * (x^z) / z!) = -log(exp(-x) * (x^z)) + log(z!) ~ -log(exp(-x)) - log(x^z) [+ z * log(z) - z + 0.5 * log(2 * pi * z)] [ Note the second term is the Stirling's Approximation for log(z!). It is invariant to x and does not affect optimization, though important for correct relative loss comparisons. It is only computed when compute_full_loss == True. ] = x - z * log(x) [+ z * log(z) - z + 0.5 * log(2 * pi * z)] = exp(c) - z * c [+ z * log(z) - z + 0.5 * log(2 * pi * z)]
Args:
log_input: A Tensor
of type float32
or float64
.
targets: A Tensor
of the same type and shape as log_input
.
compute_full_loss: whether to compute the full loss. If false, a constant
term is dropped in favor of more efficient optimization.
name: A name for the operation (optional).
Returns:
A Tensor
of the same shape as log_input
with the componentwise
logistic losses.
Raises:
ValueError: If log_input
and targets
do not have the same shape.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def log_poisson_loss_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.log_poisson_loss_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.log_poisson_loss_layer
Return
Applicative
Origial documentation for Builder.log_poisson_loss_layer
def log_poisson_loss_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.nn.log_poisson_loss, ...)
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.log_poisson_loss
def log_poisson_loss(log_input, targets, compute_full_loss=False, name=None):
Computes log poisson loss given log_input
.
Gives the log-likelihood loss between the prediction and the target under the assumption that the target has a poisson distribution. Caveat: By default, this is not the exact loss, but the loss minus a constant term [log(z!)]. That has no effect for optimization, but does not play well with relative loss comparisons. To compute an approximation of the log factorial term, specify compute_full_loss=True to enable Stirling's Approximation.
For brevity, let c = log(x) = log_input
, z = targets
. The log poisson
loss is
-log(exp(-x) * (x^z) / z!) = -log(exp(-x) * (x^z)) + log(z!) ~ -log(exp(-x)) - log(x^z) [+ z * log(z) - z + 0.5 * log(2 * pi * z)] [ Note the second term is the Stirling's Approximation for log(z!). It is invariant to x and does not affect optimization, though important for correct relative loss comparisons. It is only computed when compute_full_loss == True. ] = x - z * log(x) [+ z * log(z) - z + 0.5 * log(2 * pi * z)] = exp(c) - z * c [+ z * log(z) - z + 0.5 * log(2 * pi * z)]
Args:
log_input: A Tensor
of type float32
or float64
.
targets: A Tensor
of the same type and shape as log_input
.
compute_full_loss: whether to compute the full loss. If false, a constant
term is dropped in favor of more efficient optimization.
name: A name for the operation (optional).
Returns:
A Tensor
of the same shape as log_input
with the componentwise
logistic losses.
Raises:
ValueError: If log_input
and targets
do not have the same shape.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def log_softmax(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.log_softmax, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.log_softmax
Return
Applicative
Origial documentation for Builder.log_softmax
def log_softmax(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.nn.log_softmax
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.log_softmax
def log_softmax(logits, dim=-1, name=None)
Computes log softmax activations.
For each batch i
and class j
we have
logsoftmax = logits - reduce_sum(exp(logits), dim)
Args:
logits: A non-empty Tensor
. Must be one of the following types: half
,
float32
, float64
.
dim: The dimension softmax would be performed on. The default is -1 which
indicates the last dimension.
name: A name for the operation (optional).
Returns:
A Tensor
. Has the same type as logits
. Same shape as logits
.
Raises:
InvalidArgumentError: if logits
is empty or dim
is beyond the last
dimension of logits
.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def log_softmax_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.log_softmax_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.log_softmax_layer
Return
Applicative
Origial documentation for Builder.log_softmax_layer
def log_softmax_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.nn.log_softmax, ...)
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.log_softmax
def log_softmax(logits, dim=-1, name=None):
Computes log softmax activations.
For each batch i
and class j
we have
logsoftmax = logits - reduce_sum(exp(logits), dim)
Args:
logits: A non-empty Tensor
. Must be one of the following types: half
,
float32
, float64
.
dim: The dimension softmax would be performed on. The default is -1 which
indicates the last dimension.
name: A name for the operation (optional).
Returns:
A Tensor
. Has the same type as logits
. Same shape as logits
.
Raises:
InvalidArgumentError: if logits
is empty or dim
is beyond the last
dimension of logits
.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def log_uniform_candidate_sampler(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.log_uniform_candidate_sampler, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.log_uniform_candidate_sampler
Return
Applicative
Origial documentation for Builder.log_uniform_candidate_sampler
def log_uniform_candidate_sampler(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.nn.log_uniform_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.log_uniform_candidate_sampler
def log_uniform_candidate_sampler(true_classes, num_true, num_sampled, unique, range_max, seed=None, name=None)
Samples a set of classes using a log-uniform (Zipfian) 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 for this operation is an approximately log-uniform or Zipfian distribution:
P(class) = (log(class + 2) - log(class + 1)) / log(range_max + 1)
This sampler is useful when the target classes approximately follow such a distribution - for example, if the classes represent words in a lexicon sorted in decreasing order of frequency. If your classes are not ordered by decreasing frequency, do not use this op.
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.
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 log_uniform_candidate_sampler_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.log_uniform_candidate_sampler_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.log_uniform_candidate_sampler_layer
Return
Applicative
Origial documentation for Builder.log_uniform_candidate_sampler_layer
def log_uniform_candidate_sampler_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.nn.log_uniform_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.log_uniform_candidate_sampler
def log_uniform_candidate_sampler(true_classes, num_true, num_sampled, unique, range_max, seed=None, name=None):
Samples a set of classes using a log-uniform (Zipfian) 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 for this operation is an approximately log-uniform or Zipfian distribution:
P(class) = (log(class + 2) - log(class + 1)) / log(range_max + 1)
This sampler is useful when the target classes approximately follow such a distribution - for example, if the classes represent words in a lexicon sorted in decreasing order of frequency. If your classes are not ordered by decreasing frequency, do not use this op.
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.
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 logical_and(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.logical_and, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.logical_and
Return
Applicative
Origial documentation for Builder.logical_and
def logical_and(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.logical_and
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.logical_and
def logical_and(x, y, name=None)
Returns the truth value of x AND y element-wise.
NOTE: LogicalAnd
supports broadcasting.
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 logical_and_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.logical_and_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.logical_and_layer
Return
Applicative
Origial documentation for Builder.logical_and_layer
def logical_and_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.logical_and, ...)
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.logical_and
def logical_and(x, y, name=None):
Returns the truth value of x AND y element-wise.
NOTE: LogicalAnd
supports broadcasting.
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 logical_not(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.logical_not, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.logical_not
Return
Applicative
Origial documentation for Builder.logical_not
def logical_not(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.logical_not
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.logical_not
def logical_not(x, name=None)
Returns the truth value of NOT x element-wise.
Args:
x: A Tensor
of type bool
.
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 logical_not_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.logical_not_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.logical_not_layer
Return
Applicative
Origial documentation for Builder.logical_not_layer
def logical_not_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.logical_not, ...)
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.logical_not
def logical_not(x, name=None):
Returns the truth value of NOT x element-wise.
Args:
x: A Tensor
of type bool
.
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 logical_or(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.logical_or, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.logical_or
Return
Applicative
Origial documentation for Builder.logical_or
def logical_or(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.logical_or
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.logical_or
def logical_or(x, y, name=None)
Returns the truth value of x OR y element-wise.
NOTE: LogicalOr
supports broadcasting.
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 logical_or_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.logical_or_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.logical_or_layer
Return
Applicative
Origial documentation for Builder.logical_or_layer
def logical_or_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.logical_or, ...)
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.logical_or
def logical_or(x, y, name=None):
Returns the truth value of x OR y element-wise.
NOTE: LogicalOr
supports broadcasting.
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 logical_xor(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.logical_xor, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.logical_xor
Return
Applicative
Origial documentation for Builder.logical_xor
def logical_xor(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.logical_xor
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.logical_xor
def logical_xor(x, y, name="LogicalXor")
x ^ y = (x | y) & ~(x & y).
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def logical_xor_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.logical_xor_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.logical_xor_layer
Return
Applicative
Origial documentation for Builder.logical_xor_layer
def logical_xor_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.logical_xor, ...)
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.logical_xor
def logical_xor(x, y, name="LogicalXor"):
x ^ y = (x | y) & ~(x & y).
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def lrn(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.lrn, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.lrn
Return
Applicative
Origial documentation for Builder.lrn
def lrn(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.nn.lrn
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.lrn
def lrn(input, depth_radius=None, bias=None, alpha=None, beta=None, name=None)
Local Response Normalization.
The 4-D input
tensor is treated as a 3-D array of 1-D vectors (along the last
dimension), and each vector is normalized independently. Within a given vector,
each component is divided by the weighted, squared sum of inputs within
depth_radius
. In detail,
sqr_sum[a, b, c, d] = sum(input[a, b, c, d - depth_radius : d + depth_radius + 1] ** 2) output = input / (bias + alpha * sqr_sum) ** beta
For details, see [Krizhevsky et al., ImageNet classification with deep convolutional neural networks (NIPS 2012)] (http://papers.nips.cc/paper/4824-imagenet-classification-with-deep-convolutional-neural-networks).
Args:
input: A Tensor
. Must be one of the following types: float32
, half
.
4-D.
depth_radius: An optional int
. Defaults to 5
.
0-D. Half-width of the 1-D normalization window.
bias: An optional float
. Defaults to 1
.
An offset (usually positive to avoid dividing by 0).
alpha: An optional float
. Defaults to 1
.
A scale factor, usually positive.
beta: An optional float
. Defaults to 0.5
. An exponent.
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 lrn_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.lrn_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.lrn_layer
Return
Applicative
Origial documentation for Builder.lrn_layer
def lrn_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.nn.lrn, ...)
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.lrn
def lrn(input, depth_radius=None, bias=None, alpha=None, beta=None, name=None):
Local Response Normalization.
The 4-D input
tensor is treated as a 3-D array of 1-D vectors (along the last
dimension), and each vector is normalized independently. Within a given vector,
each component is divided by the weighted, squared sum of inputs within
depth_radius
. In detail,
sqr_sum[a, b, c, d] = sum(input[a, b, c, d - depth_radius : d + depth_radius + 1] ** 2) output = input / (bias + alpha * sqr_sum) ** beta
For details, see [Krizhevsky et al., ImageNet classification with deep convolutional neural networks (NIPS 2012)] (http://papers.nips.cc/paper/4824-imagenet-classification-with-deep-convolutional-neural-networks).
Args:
input: A Tensor
. Must be one of the following types: float32
, half
.
4-D.
depth_radius: An optional int
. Defaults to 5
.
0-D. Half-width of the 1-D normalization window.
bias: An optional float
. Defaults to 1
.
An offset (usually positive to avoid dividing by 0).
alpha: An optional float
. Defaults to 1
.
A scale factor, usually positive.
beta: An optional float
. Defaults to 0.5
. An exponent.
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 make_all(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.make_all, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.make_all
Return
Applicative
Origial documentation for Builder.make_all
def make_all(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.nn.make_all
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.make_all
def make_all(module_name, doc_string_modules=None)
Generates __all__
from the docstring of one or more modules.
Usage: make_all(__name__)
or
make_all(__name__, [sys.modules(__name__), other_module])
. The doc string
modules must each a docstring, and __all__
will contain all symbols with
@@
references, where that symbol currently exists in the module named
module_name
.
Args:
module_name: The name of the module (usually __name__
).
doc_string_modules: a list of modules from which to take docstring.
If None, then a list containing only the module named module_name
is used.
Returns:
A list suitable for use as __all__
.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def make_all_layer(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.make_all_layer, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.make_all_layer
Return
Applicative
Origial documentation for Builder.make_all_layer
def make_all_layer(builder, size):
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .fully_connected(size, activation_fn = tf.nn.make_all, ...)
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.make_all
def make_all(module_name, doc_string_modules=None):
Generates __all__
from the docstring of one or more modules.
Usage: make_all(__name__)
or
make_all(__name__, [sys.modules(__name__), other_module])
. The doc string
modules must each a docstring, and __all__
will contain all symbols with
@@
references, where that symbol currently exists in the module named
module_name
.
Args:
module_name: The name of the module (usually __name__
).
doc_string_modules: a list of modules from which to take docstring.
If None, then a list containing only the module named module_name
is used.
Returns:
A list suitable for use as __all__
.
def _method(app, *args, **kwargs): def _lambda(builder): g = getattr(builder, f.__name__) return g(*args, **kwargs) return app.compose(_lambda)
def make_template(
app, *args, **kwargs)
THIS METHOD IS AUTOMATICALLY GENERATED
Alias for .compose(Builder.make_template, ...)
Arguments
- All other *args and **kwargs are forwarded to
Builder.make_template
Return
Applicative
Origial documentation for Builder.make_template
def make_template(builder):
THIS METHOD IS AUTOMATICALLY GENERATED
@immutable
This method is a lifted version the function tf.make_template
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.make_template
def make_template(name_, func_, create_scope_now_=False, unique_name_=None)
Given an arbitrary function, wrap it so that it does variable sharing.
This wraps func_
in a Template and partially evaluates it. Templates are
functions that create variables the first time they are called and reuse them
thereafter. In order for func_
to be compatible with a Template
it must
have the following properties:
- The function should create all trainable variables and any variables that
should be reused by calling
tf.get_variable
. If a trainable variable is created usingtf.Variable
, then a ValueError will be thrown. Variables that are intended to be locals can be created by specifyingtf.Variable(..., trainable=false)
. - The function may use variable scopes and other templates internally to
create and reuse variables, but it shouldn't use
tf.get_variables
to capture variables that are defined outside of the scope of the function. - Internal scopes and variable names should not depend on any arguments that
are not supplied to
make_template
. In general you will get a ValueError telling you that you are trying to reuse a variable that doesn't exist if you make a mistake.
In the following example, both z
and w
will be scaled by the same y
. It
is important to note that if we didn't assign scalar_name
and used a
different name for z and w that a ValueError
would be thrown because it
couldn't reuse the variable.
```python def my_op(x, scalar_name): var1 = tf.get_variable(scalar_name, shape=[], initializer=tf.constant_initializer(1)) return x * var1
scale_by_y = tf.make_template('scale_by_y', my_op, scalar_name='y')
z = scale_by_y(input1) w = scale_by_y(input2) ```
As a safe-guard, the returned function will raise a ValueError
after the
first call if trainable variables are created by calling tf.Variable
.
If all of these are true, then 2 properties are enforced by the template:
- Calling the same template multiple times will share all non-local variables.
- Two different templates are guaranteed to be unique, unless you reenter the same variable scope as the initial definition of a template and redefine it. An examples of this exception:
```python def my_op(x, scalar_name): var1 = tf.get_variable(scalar_name, shape=[], initializer=tf.constant_initializer(1)) return x * var1
with tf.variable_scope('scope') as vs: scale_by_y = tf.make_template('scale_by_y', my_op, scalar_name='y') z = scale_by_y(input1) w = scale_by_y(input2)
Creates a template that reuses the variables above.
with tf.variable_scope(vs, reuse=True): scale_by_y2 = tf.make_template('scale_by_y', my_op, scalar_name='y') z2 = scale_by_y2(input1) w2 = scale_by_y2(input2) ```
Depending on the value of create_scope_now_
, the full variable scope may be
captured either at the time of first call or at the time of construction. If
this option is set to True, then all Tensors created by repeated calls to the
template will have an extra trailing _N+1 to their name, as the first time the
scope is entered in the Template constructor no Tensors are created.
Note: name_
, func_
and create_scope_now_
have a trailing underscore to
reduce the likelihood of collisions with kwargs.
Args:
name_: A name for the scope created by this template. If necessary, the name
will be made unique by appending _N
to the name.
func_: The function to wrap.
create_scope_now_: Boolean controlling whether the scope should be created
when the template is constructed or when the template is called. Default
is False, meaning the scope is created when the template is called.
unique_name_: When used, it overrides name_ and is not made unique. If a