Layers Reference
Complete reference for all layer types in Deeplearning4j — Dense, Activation, Dropout, Embedding, BatchNormalization, and more
Overview
new LayerType.Builder()
.nIn(inputSize)
.nOut(outputSize)
.activation(Activation.RELU)
// ...other options...
.build()Common Builder Options (All Layers)
Method
Description
DenseLayer
Builder Parameters
Parameter
Type
Default
Description
Example
With Layer Normalization
OutputLayer
Builder Parameters
Parameter
Type
Description
Classification Example
Regression Example
Common Loss Functions
LossFunction
Use Case
LossLayer
Example
ActivationLayer
Example
DropoutLayer
Builder Parameters
Parameter
Type
Description
Example
BatchNormalization
Builder Parameters
Parameter
Type
Default
Description
Example — After a Dense Layer
Example — After a Convolutional Layer
EmbeddingLayer
Builder Parameters
Parameter
Type
Default
Description
Example — Basic
Example — Pre-trained Embeddings
EmbeddingSequenceLayer
Builder Parameters
Parameter
Type
Default
Description
Example
GlobalPoolingLayer
Builder Parameters
Parameter
Type
Default
Description
Example — Global Average Pooling after CNN
Example — Global Max Pooling for sequence classification
LocalResponseNormalization
Builder Parameters
Parameter
Default
Description
ElementWiseMultiplicationLayer
RepeatVector
Builder Parameters
Parameter
Type
Description
Example
MaskLayer
MaskZeroLayer
LocallyConnected1D / LocallyConnected2D
LocallyConnected1D
LocallyConnected2D
Full Configuration Example (MLP Classifier, M2.1)
Last updated
Was this helpful?