About Keras
Getting started
Developer guides
Code examples
Keras 3 API documentation
Keras 2 API documentation
Models API
Layers API
The base Layer class
Layer activations
Layer weight initializers
Layer weight regularizers
Layer weight constraints
Core layers
Convolution layers
Pooling layers
Recurrent layers
Preprocessing layers
Normalization layers
Regularization layers
Attention layers
Reshaping layers
Merging layers
Activation layers
Callbacks API
Optimizers
Metrics
Losses
Data loading
Built-in small datasets
Keras Applications
Mixed precision
Utilities
KerasTuner: Hyperparam Tuning
KerasHub: Pretrained Models
search
►
Keras 2 API documentation
/ Layers API
Layers API
The base Layer class
Layer class
weights property
trainable_weights property
non_trainable_weights property
add_weight method
trainable property
get_weights method
set_weights method
get_config method
add_loss method
losses property
Layer activations
relu function
sigmoid function
softmax function
softplus function
softsign function
tanh function
selu function
elu function
exponential function
Layer weight initializers
RandomNormal class
RandomUniform class
TruncatedNormal class
Zeros class
Ones class
GlorotNormal class
GlorotUniform class
HeNormal class
HeUniform class
Identity class
Orthogonal class
Constant class
VarianceScaling class
Layer weight regularizers
L1 class
L2 class
L1L2 class
OrthogonalRegularizer class
Layer weight constraints
MaxNorm class
MinMaxNorm class
NonNeg class
UnitNorm class
RadialConstraint class
Core layers
Input object
Dense layer
Activation layer
Embedding layer
Masking layer
Lambda layer
Convolution layers
Conv1D layer
Conv2D layer
Conv3D layer
SeparableConv1D layer
SeparableConv2D layer
DepthwiseConv2D layer
Conv1DTranspose layer
Conv2DTranspose layer
Conv3DTranspose layer
Pooling layers
MaxPooling1D layer
MaxPooling2D layer
MaxPooling3D layer
AveragePooling1D layer
AveragePooling2D layer
AveragePooling3D layer
GlobalMaxPooling1D layer
GlobalMaxPooling2D layer
GlobalMaxPooling3D layer
GlobalAveragePooling1D layer
GlobalAveragePooling2D layer
GlobalAveragePooling3D layer
Recurrent layers
LSTM layer
GRU layer
SimpleRNN layer
TimeDistributed layer
Bidirectional layer
ConvLSTM1D layer
ConvLSTM2D layer
ConvLSTM3D layer
Base RNN layer
Preprocessing layers
Text preprocessing
Numerical features preprocessing layers
Categorical features preprocessing layers
Image preprocessing layers
Image augmentation layers
Normalization layers
BatchNormalization layer
LayerNormalization layer
UnitNormalization layer
GroupNormalization layer
Regularization layers
Dropout layer
SpatialDropout1D layer
SpatialDropout2D layer
SpatialDropout3D layer
GaussianDropout layer
GaussianNoise layer
ActivityRegularization layer
Attention layers
MultiHeadAttention layer
Attention layer
AdditiveAttention layer
Reshaping layers
Reshape layer
Flatten layer
RepeatVector layer
Permute layer
Cropping1D layer
Cropping2D layer
Cropping3D layer
UpSampling1D layer
UpSampling2D layer
UpSampling3D layer
ZeroPadding1D layer
ZeroPadding2D layer
ZeroPadding3D layer
Merging layers
Concatenate layer
Average layer
Maximum layer
Minimum layer
Add layer
Subtract layer
Multiply layer
Dot layer
Activation layers
ReLU layer
Softmax layer
LeakyReLU layer
PReLU layer
ELU layer
ThresholdedReLU layer
Layers API
The base Layer class
Layer activations
Layer weight initializers
Layer weight regularizers
Layer weight constraints
Core layers
Convolution layers
Pooling layers
Recurrent layers
Preprocessing layers
Normalization layers
Regularization layers
Attention layers
Reshaping layers
Merging layers
Activation layers