Type Layer
Namespace tensorflow.keras.layers
Parent Module
Interfaces ILayer
Base layer class. This is the class from which all layers inherit. A layer is a class implementing common neural networks operations, such
as convolution, batch norm, etc. These operations require managing weights,
losses, updates, and inter-layer connectivity. Users will just instantiate a layer and then treat it as a callable. We recommend that descendants of `Layer` implement the following methods: * `__init__()`: Save configuration in member variables
* `build()`: Called once from `__call__`, when we know the shapes of inputs
and `dtype`. Should have the calls to `add_weight()`, and then
call the super's `build()` (which sets `self.built = True`, which is
nice in case the user wants to call `build()` manually before the
first `__call__`).
* `call()`: Called in `__call__` after making sure `build()` has been called
once. Should actually perform the logic of applying the layer to the
input tensors (which should be passed in as the first argument).
Methods
Properties
- activity_regularizer
- activity_regularizer_dyn
- built
- dtype
- dtype_dyn
- dynamic
- dynamic_dyn
- inbound_nodes
- inbound_nodes_dyn
- input
- input_dyn
- input_mask
- input_mask_dyn
- input_shape
- input_shape_dyn
- input_spec
- input_spec_dyn
- losses
- losses_dyn
- metrics
- metrics_dyn
- name
- name_dyn
- name_scope
- name_scope_dyn
- non_trainable_variables
- non_trainable_variables_dyn
- non_trainable_weights
- non_trainable_weights_dyn
- outbound_nodes
- outbound_nodes_dyn
- output
- output_dyn
- output_mask
- output_mask_dyn
- output_shape
- output_shape_dyn
- PythonObject
- stateful
- submodules
- submodules_dyn
- supports_masking
- trainable
- trainable_dyn
- trainable_variables
- trainable_variables_dyn
- trainable_weights
- trainable_weights_dyn
- updates
- updates_dyn
- variables
- variables_dyn
- weights
- weights_dyn
Public static methods
Layer NewDyn(ImplicitContainer<T> trainable, object name, object dtype, ImplicitContainer<T> dynamic, IDictionary<string, object> kwargs)
Public properties
PythonFunctionContainer activity_regularizer get; set;
Optional regularizer function for the output of this layer.
object activity_regularizer_dyn get; set;
Optional regularizer function for the output of this layer.
bool built get; set;
object dtype get;
object dtype_dyn get;
bool dynamic get;
object dynamic_dyn get;
IList<Node> inbound_nodes get;
object inbound_nodes_dyn get;
IList<object> input get;
Retrieves the input tensor(s) of a layer. Only applicable if the layer has exactly one input,
i.e. if it is connected to one incoming layer.
object input_dyn get;
Retrieves the input tensor(s) of a layer. Only applicable if the layer has exactly one input,
i.e. if it is connected to one incoming layer.
object input_mask get;
Retrieves the input mask tensor(s) of a layer. Only applicable if the layer has exactly one inbound node,
i.e. if it is connected to one incoming layer.
object input_mask_dyn get;
Retrieves the input mask tensor(s) of a layer. Only applicable if the layer has exactly one inbound node,
i.e. if it is connected to one incoming layer.
IList<object> input_shape get;
Retrieves the input shape(s) of a layer. Only applicable if the layer has exactly one input,
i.e. if it is connected to one incoming layer, or if all inputs
have the same shape.
object input_shape_dyn get;
Retrieves the input shape(s) of a layer. Only applicable if the layer has exactly one input,
i.e. if it is connected to one incoming layer, or if all inputs
have the same shape.
object input_spec get; set;
object input_spec_dyn get; set;
IList<object> losses get;
Losses which are associated with this `Layer`. Variable regularization tensors are created when this property is accessed,
so it is eager safe: accessing `losses` under a
tf.GradientTape
will
propagate gradients back to the corresponding variables.
object losses_dyn get;
Losses which are associated with this `Layer`. Variable regularization tensors are created when this property is accessed,
so it is eager safe: accessing `losses` under a
tf.GradientTape
will
propagate gradients back to the corresponding variables.
IList<object> metrics get;
object metrics_dyn get;
object name get;
Returns the name of this module as passed or determined in the ctor. NOTE: This is not the same as the `self.name_scope.name` which includes
parent module names.
object name_dyn get;
Returns the name of this module as passed or determined in the ctor. NOTE: This is not the same as the `self.name_scope.name` which includes
parent module names.
object name_scope get;
object name_scope_dyn get;
IList<object> non_trainable_variables get;
object non_trainable_variables_dyn get;
IList<object> non_trainable_weights get;
object non_trainable_weights_dyn get;
IList<object> outbound_nodes get;
object outbound_nodes_dyn get;
IList<object> output get;
Retrieves the output tensor(s) of a layer. Only applicable if the layer has exactly one output,
i.e. if it is connected to one incoming layer.
object output_dyn get;
Retrieves the output tensor(s) of a layer. Only applicable if the layer has exactly one output,
i.e. if it is connected to one incoming layer.
object output_mask get;
Retrieves the output mask tensor(s) of a layer. Only applicable if the layer has exactly one inbound node,
i.e. if it is connected to one incoming layer.
object output_mask_dyn get;
Retrieves the output mask tensor(s) of a layer. Only applicable if the layer has exactly one inbound node,
i.e. if it is connected to one incoming layer.
object output_shape get;
Retrieves the output shape(s) of a layer. Only applicable if the layer has one output,
or if all outputs have the same shape.
object output_shape_dyn get;
Retrieves the output shape(s) of a layer. Only applicable if the layer has one output,
or if all outputs have the same shape.
object PythonObject get;
bool stateful get; set;
ValueTuple<object> submodules get;
object submodules_dyn get;
bool supports_masking get; set;
bool trainable get; set;
object trainable_dyn get; set;
object trainable_variables get;
Sequence of variables owned by this module and it's submodules. Note: this method uses reflection to find variables on the current instance
and submodules. For performance reasons you may wish to cache the result
of calling this method if you don't expect the return value to change.
object trainable_variables_dyn get;
Sequence of variables owned by this module and it's submodules. Note: this method uses reflection to find variables on the current instance
and submodules. For performance reasons you may wish to cache the result
of calling this method if you don't expect the return value to change.
IList<object> trainable_weights get;
object trainable_weights_dyn get;
IList<object> updates get;
object updates_dyn get;
object variables get;
Returns the list of all layer variables/weights. Alias of `self.weights`.
object variables_dyn get;
Returns the list of all layer variables/weights. Alias of `self.weights`.
IList<object> weights get;
Returns the list of all layer variables/weights.
object weights_dyn get;
Returns the list of all layer variables/weights.