tf.compat.v1.layers.Layer
Stay organized with collections
Save and categorize content based on your preferences.
Base layer class.
Inherits From: Layer
, Module
tf.compat.v1.layers.Layer(
trainable=True, name=None, dtype=None, **kwargs
)
It is considered legacy, and we recommend the use of tf.keras.layers.Layer
instead.
Args |
trainable
|
Boolean, whether the layer's variables should be trainable.
|
name
|
String name of the layer.
|
dtype
|
Default dtype of the layer's weights (default of None means use
the type of the first input).
|
Read-only properties:
name: The name of the layer (string).
dtype: Default dtype of the layer's weights (default of None
means use
the type of the first input).
trainable_variables: List of trainable variables.
non_trainable_variables: List of non-trainable variables.
variables: List of all variables of this layer, trainable and
non-trainable.
updates: List of update ops of this layer.
losses: List of losses added by this layer.
trainable_weights: List of variables to be included in backprop.
non_trainable_weights: List of variables that should not be
included in backprop.
weights: The concatenation of the lists trainable_weights and
non_trainable_weights (in this order).
Mutable properties |
trainable
|
Whether the layer should be trained (boolean).
|
input_spec
|
Optional (list of) InputSpec object(s) specifying the
constraints on inputs that can be accepted by the layer.
|
Attributes |
graph
|
|
scope_name
|
|
Methods
apply
View source
apply(
*args, **kwargs
)
get_losses_for
View source
get_losses_for(
inputs
)
Retrieves losses relevant to a specific set of inputs.
Args |
inputs
|
Input tensor or list/tuple of input tensors.
|
Returns |
List of loss tensors of the layer that depend on inputs .
|
get_updates_for
View source
get_updates_for(
inputs
)
Retrieves updates relevant to a specific set of inputs.
Args |
inputs
|
Input tensor or list/tuple of input tensors.
|
Returns |
List of update ops of the layer that depend on inputs .
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2023-10-06 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-10-06 UTC."],[],[]]