Overview
- namespace: Rindow\NeuralNetworks\Builder
- classname: Layers
Create new layer instances.
Create an instance of each layer by calling method with the same name as the class name of the layer. Refer to the constructor of each layer for details.
Layers
- Dense: Regular densely-connected Neural Networks layer.
- Flatten: Flattens the input.
- ExpandDims: ExpandDims the input.
- Concatenate: Concatenate the input.
- Embedding: Embedding the input.
- RepeatVector: RepeatVector the input.
- Gather: Gather the input.
- Max: Max the input.
- Dropout: Applies Dropout to the input.
- BatchNormalization: Normalize the previous activation function layer at each batch.
- Conv1D: 1D convolution layer.
- Conv2D: 2D convolution layer.
- Conv3D: 3D convolution layer.
- MaxPooling1D: Max pooling operation for 1D temporal data.
- MaxPooling2D: Max pooling operation for 2D temporal data.
- MaxPooling3D: Max pooling operation for 3D temporal data.
- AveragePooling1D: Average pooling operation for 1D temporal data.
- AveragePooling2D: Average pooling operation for 2D temporal data.
- AveragePooling3D: Average pooling operation for 3D temporal data.
- GlobalMaxPooling1D
- GlobalMaxPooling2D
- GlobalMaxPooling3D
- GlobalAveragePooling1D
- GlobalAveragePooling2D
- GlobalAveragePooling3D
- SimpleRNN
- LSTM
- GRU
- Attention
Activations
- relu: Rectified Linear Unit activation function.
- sigmoid: Sigmoid activation function.
- softmax: Softmax activation function.
- tanh: Tanh activation function.
- linear: Pass through
Examples
use Rindow\Math\Matrix\MatrixOperator;
use Rindow\NeuralNetworks\Builder\NeuralNetworks;
$mo = new MatrixOperator();
$nn = new NeuralNetworks($mo);
$model = $nn->models()->Sequential([
$nn->layers()->Dense(128,input_shape:[10],activation='sigmoid');
$nn->layers()->Dense(1);
$nn->layers()->Activation('sigmoid');
]);