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: ADFLayer

Densly-connected (fully connected) neural network layer.

Assumed Density Filtering (ADF) version of keras.layers.Dense.

Parameters:
unitsint

Dimensionality of the output space (number of neurons).

activationcallable() or str, 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_initializerInitializer or str, optional

Initializer for the kernel weights matrix. Default is glorot_uniform initialization.

bias_initializerInitializer or str, optional

Initializer for the bias vector. Default is None.

kernel_regularizerRegularizer or str, optional

Regularizer function applied to the kernel weights matrix. Default is None.

bias_regularizerRegularizer or str, optional

Regularizer function applied to the bias vector. Default is None.

activity_regularizerRegularizer or str, optional

Regularizer function applied to the output of the layer. Default is None.

kernel_constraintConstraint or str, optional

Constraint function applied to the kernel weights matrix. Default is None.

bias_constraintConstraint or str, optional

Constraint function applied to the bias vector. Default is None.

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(input_shape)
call(inputs)
compute_output_shape(input_shape)
get_config()