Keras Layers
10 nodes
On this page 10
Add
FunctionAdds several branches of the same shape, element by element, as a residual connection does.
Add(inputs: KerasTensor Array) -> KerasTensor
KerasTensor Add(KerasTensor[] inputs)
Parameters
| name | type | default | description |
|---|---|---|---|
| inputs | KerasTensor Array | — | The branches. |
Returns
| Tensor | KerasTensor |
- Ships with
- Divooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Keras Layers
- Package
- Machine Learning
Batch Normalization
FunctionRescales its inputs to a steady mean and spread, batch by batch, which makes deeper networks train faster.
BatchNormalization(input: KerasTensor) -> KerasTensor
KerasTensor BatchNormalization(KerasTensor input)
Parameters
| name | type | default | description |
|---|---|---|---|
| input | KerasTensor | — | The tensor before. |
Returns
| Tensor | KerasTensor |
- Ships with
- Divooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Keras Layers
- Package
- Machine Learning
Concatenate
FunctionJoins several branches side by side, along their last axis.
Concatenate(inputs: KerasTensor Array) -> KerasTensor
KerasTensor Concatenate(KerasTensor[] inputs)
Parameters
| name | type | default | description |
|---|---|---|---|
| inputs | KerasTensor Array | — | The branches. |
Returns
| Tensor | KerasTensor |
- Ships with
- Divooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Keras Layers
- Package
- Machine Learning
Conv2D
FunctionA 2D convolution: small filters slid over a picture-shaped input (height, width, channels), each finding one kind of pattern.
Conv2D -> KerasTensor
input: KerasTensor
filters: Integer
kernelSize: Integer
activation: TextKerasTensor Conv2D(
KerasTensor input,
int filters,
int kernelSize = 3,
string activation = "relu")Parameters
| name | type | default | description |
|---|---|---|---|
| input | KerasTensor | — | The tensor before, shaped height, width, channels. |
| filters | Integer | — | How many filters, which is how many channels the output has. |
| kernelSize | Integer | 3 | Each filter's width and height in pixels. |
| activation | Text | relu | relu, sigmoid...; empty for none. |
Returns
| Tensor | KerasTensor |
- Ships with
- Divooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Keras Layers
- Package
- Machine Learning
Dense
FunctionA fully connected layer: every output is a weighted sum of every input, then the activation.
Dense -> KerasTensor
input: KerasTensor
units: Integer
activation: TextKerasTensor Dense(
KerasTensor input,
int units,
string activation)Parameters
| name | type | default | description |
|---|---|---|---|
| input | KerasTensor | — | The tensor before. |
| units | Integer | — | How many outputs. |
| activation | Text | — | relu, sigmoid, softmax, tanh, gelu...; empty for none (a linear output). |
Returns
| Tensor | KerasTensor |
- Ships with
- Divooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Keras Layers
- Package
- Machine Learning
Dropout
FunctionDrops a share of its inputs at random while training, against overfitting; does nothing when predicting.
Dropout(input: KerasTensor, rate: Number) -> KerasTensor
KerasTensor Dropout(KerasTensor input, double rate = 0.2)
Parameters
| name | type | default | description |
|---|---|---|---|
| input | KerasTensor | — | The tensor before. |
| rate | Number | 0.2 | The share dropped, between 0 and 1. |
Returns
| Tensor | KerasTensor |
- Ships with
- Divooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Keras Layers
- Package
- Machine Learning
Flatten
FunctionLays a shaped input out as one row of numbers, as a Dense layer after convolutions needs.
Flatten(input: KerasTensor) -> KerasTensor
KerasTensor Flatten(KerasTensor input)
Parameters
| name | type | default | description |
|---|---|---|---|
| input | KerasTensor | — | The tensor before. |
Returns
| Tensor | KerasTensor |
- Ships with
- Divooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Keras Layers
- Package
- Machine Learning
Input
FunctionWhere data enters the network: one example's shape, without the batch.
Input -> KerasTensor
shape: Integer Array
name: Text
seed: IntegerKerasTensor Input(int[] shape, string name, int seed = -1)
Parameters
| name | type | default | description |
|---|---|---|---|
| shape | Integer Array | — | The shape of one example, such as 4 for four numbers or 28, 28, 1 for a small grey picture. |
| name | Text | — | A name for the input; empty for Keras's own. |
| seed | Integer | -1 | The seed the starting weights of the layers drawn after this input come from, as keras.utils.set_random_seed sets it; negative leaves them random. |
Returns
| Tensor | KerasTensor |
Remarks
Layers draw their starting weights as they are joined to the network, which happens after the Input they hang from, so seeding here makes the whole network's start repeatable.
- Ships with
- Divooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Keras Layers
- Package
- Machine Learning
Layer Normalization
FunctionRescales each example's features to a steady mean and spread.
LayerNormalization(input: KerasTensor) -> KerasTensor
KerasTensor LayerNormalization(KerasTensor input)
Parameters
| name | type | default | description |
|---|---|---|---|
| input | KerasTensor | — | The tensor before. |
Returns
| Tensor | KerasTensor |
- Ships with
- Divooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Keras Layers
- Package
- Machine Learning
Max Pooling 2D
FunctionHalves a picture-shaped input's width and height (by default), keeping the strongest value of each patch.
MaxPooling2D -> KerasTensor
input: KerasTensor
poolSize: IntegerKerasTensor MaxPooling2D(KerasTensor input, int poolSize = 2)
Parameters
| name | type | default | description |
|---|---|---|---|
| input | KerasTensor | — | The tensor before, shaped height, width, channels. |
| poolSize | Integer | 2 | The patch's width and height. |
Returns
| Tensor | KerasTensor |
- Ships with
- Divooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Keras Layers
- Package
- Machine Learning