Skip to content

DenseBlock

latent.layers.DenseBlock

Basic dense layer block with regularization, dropout, and batch-/layernorm functionality.

__init__(self, units, name=None, dropout_rate=0.1, batchnorm=True, layernorm=False, l1=0.0, l2=0.0, activation='leaky_relu', initializer='glorot_normal') special

Parameters:

Name Type Description Default
units int

Positive integer, dimensionality of the output space.

required
name str

String indicating the name of the layer.

None
dropout_rate float

Float between 0 and 1. Fraction of the input units to drop.

0.1
batchnorm bool

Boolean, whether to perform batch normalization.

True
layernorm bool

Boolean, whether to perform layer normalization.

False
l1 float

Float. L1 regularization factor.

0.0
l2 float

Float. L2 regularization factor.

0.0
activation Union[str, Callable]

Activation function to use.

'leaky_relu'
initializer Union[str, Callable]

Initializer for the kernel weights matrix.

'glorot_normal'