kerasadf.layers.core.Dense¶
-
class
kerasadf.layers.core.
Dense
(units, activation=None, use_bias=True, kernel_initializer='glorot_uniform', bias_initializer='zeros', kernel_regularizer=None, bias_regularizer=None, activity_regularizer=None, kernel_constraint=None, bias_constraint=None, **kwargs)¶ Bases:
kerasadf.layers.core.ADFLayer
Densly-connected (fully connected) neural network layer.
Assumed Density Filtering (ADF) version of
keras.layers.Dense
.- Parameters
- units
int
Dimensionality of the output space (number of neurons).
- activation
callable()
orstr
, optional Activation function to use. Default is no activation (ie. “linear” activation:
a(x) = x
).- use_biasbool
Whether the layer uses a bias vector.
- kernel_initializer
Initializer
orstr
, optional Initializer for the
kernel
weights matrix. Default isglorot_uniform
initialization.- bias_initializer
Initializer
orstr
, optional Initializer for the bias vector. Default is
None
.- kernel_regularizer
Regularizer
orstr
, optional Regularizer function applied to the
kernel
weights matrix. Default isNone
.- bias_regularizer
Regularizer
orstr
, optional Regularizer function applied to the bias vector. Default is
None
.- activity_regularizer
Regularizer
orstr
, optional Regularizer function applied to the output of the layer. Default is
None
.- kernel_constraint
Constraint
orstr
, optional Constraint function applied to the
kernel
weights matrix. Default isNone
.- bias_constraint
Constraint
orstr
, optional Constraint function applied to the bias vector. Default is
None
.
- units
Notes
- Input shape
nD tensor with shape:
(batch_size, ..., input_dim)
. The most common situation would be a 2D input with shape(batch_size, input_dim)
.- Output shape
nD tensor with shape:
(batch_size, ..., units)
. For instance, for a 2D input with shape(batch_size, input_dim)
, the output would have shape(batch_size, units)
.
-
build
(self, input_shape)¶
-
call
(self, inputs)¶
-
compute_output_shape
(self, input_shape)¶
-
get_config
(self)¶