Simply returns a (trainable) variable, regardless of input.
This layer implements the mathematical function f(x) = c
where c
is a
constant, i.e., unchanged for all x
. Like other Keras layers, the constant
is trainable
. This layer can also be interpretted as the special case of
layer_dense()
when the kernel
is forced to be the zero matrix
(tf$zeros
).
layer_variable(
object,
shape,
dtype = NULL,
activation = NULL,
initializer = "zeros",
regularizer = NULL,
constraint = NULL,
...
)
a Keras layer
What to compose the new Layer
instance with. Typically a
Sequential model or a Tensor (e.g., as returned by layer_input()
).
The return value depends on object
. If object
is:
missing or NULL
, the Layer
instance is returned.
a Sequential
model, the model with an additional layer is returned.
a Tensor, the output tensor from layer_instance(object)
is returned.
integer or integer vector specifying the shape of the output of this layer.
TensorFlow dtype
of the variable created by this layer.
An activation function. See keras::layer_dense
. Default: NULL
.
Initializer for the constant
vector.
Regularizer function applied to the constant
vector.
Constraint function applied to the constant
vector.
Additional keyword arguments passed to the keras::layer_dense
constructed by this layer.
Other layers:
layer_autoregressive()
,
layer_conv_1d_flipout()
,
layer_conv_1d_reparameterization()
,
layer_conv_2d_flipout()
,
layer_conv_2d_reparameterization()
,
layer_conv_3d_flipout()
,
layer_conv_3d_reparameterization()
,
layer_dense_flipout()
,
layer_dense_local_reparameterization()
,
layer_dense_reparameterization()
,
layer_dense_variational()