Divooka Reference

Keras Layers

10 nodes

On this page 10

Add

Function

Adds several branches of the same shape, element by element, as a residual connection does.

Signature
Add(inputs: KerasTensor Array) -> KerasTensor
KerasTensor Add(KerasTensor[] inputs)

Parameters

nametypedefaultdescription
inputsKerasTensor Array—The branches.

Returns

TensorKerasTensor
Ships with
Divooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Keras Layers
Package
Machine Learning

Batch Normalization

Function

Rescales its inputs to a steady mean and spread, batch by batch, which makes deeper networks train faster.

Signature
BatchNormalization(input: KerasTensor) -> KerasTensor
KerasTensor BatchNormalization(KerasTensor input)

Parameters

nametypedefaultdescription
inputKerasTensor—The tensor before.

Returns

TensorKerasTensor
Ships with
Divooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Keras Layers
Package
Machine Learning

Concatenate

Function

Joins several branches side by side, along their last axis.

Signature
Concatenate(inputs: KerasTensor Array) -> KerasTensor
KerasTensor Concatenate(KerasTensor[] inputs)

Parameters

nametypedefaultdescription
inputsKerasTensor Array—The branches.

Returns

TensorKerasTensor
Ships with
Divooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Keras Layers
Package
Machine Learning

Conv2D

Function

A 2D convolution: small filters slid over a picture-shaped input (height, width, channels), each finding one kind of pattern.

Signature
Conv2D -> KerasTensor
    input: KerasTensor
    filters: Integer
    kernelSize: Integer
    activation: Text
KerasTensor Conv2D(
    KerasTensor input,
    int filters,
    int kernelSize = 3,
    string activation = "relu")

Parameters

nametypedefaultdescription
inputKerasTensor—The tensor before, shaped height, width, channels.
filtersInteger—How many filters, which is how many channels the output has.
kernelSizeInteger3Each filter's width and height in pixels.
activationTextrelurelu, sigmoid...; empty for none.

Returns

TensorKerasTensor
Ships with
Divooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Keras Layers
Package
Machine Learning

Dense

Function

A fully connected layer: every output is a weighted sum of every input, then the activation.

Signature
Dense -> KerasTensor
    input: KerasTensor
    units: Integer
    activation: Text
KerasTensor Dense(
    KerasTensor input,
    int units,
    string activation)

Parameters

nametypedefaultdescription
inputKerasTensor—The tensor before.
unitsInteger—How many outputs.
activationText—relu, sigmoid, softmax, tanh, gelu...; empty for none (a linear output).

Returns

TensorKerasTensor
Ships with
Divooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Keras Layers
Package
Machine Learning

Dropout

Function

Drops a share of its inputs at random while training, against overfitting; does nothing when predicting.

Signature
Dropout(input: KerasTensor, rate: Number) -> KerasTensor
KerasTensor Dropout(KerasTensor input, double rate = 0.2)

Parameters

nametypedefaultdescription
inputKerasTensor—The tensor before.
rateNumber0.2The share dropped, between 0 and 1.

Returns

TensorKerasTensor
Ships with
Divooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Keras Layers
Package
Machine Learning

Flatten

Function

Lays a shaped input out as one row of numbers, as a Dense layer after convolutions needs.

Signature
Flatten(input: KerasTensor) -> KerasTensor
KerasTensor Flatten(KerasTensor input)

Parameters

nametypedefaultdescription
inputKerasTensor—The tensor before.

Returns

TensorKerasTensor
Ships with
Divooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Keras Layers
Package
Machine Learning

Input

Function

Where data enters the network: one example's shape, without the batch.

Signature
Input -> KerasTensor
    shape: Integer Array
    name: Text
    seed: Integer
KerasTensor Input(int[] shape, string name, int seed = -1)

Parameters

nametypedefaultdescription
shapeInteger Array—The shape of one example, such as 4 for four numbers or 28, 28, 1 for a small grey picture.
nameText—A name for the input; empty for Keras's own.
seedInteger-1The 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

TensorKerasTensor

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

Function

Rescales each example's features to a steady mean and spread.

Signature
LayerNormalization(input: KerasTensor) -> KerasTensor
KerasTensor LayerNormalization(KerasTensor input)

Parameters

nametypedefaultdescription
inputKerasTensor—The tensor before.

Returns

TensorKerasTensor
Ships with
Divooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Keras Layers
Package
Machine Learning

Max Pooling 2D

Function

Halves a picture-shaped input's width and height (by default), keeping the strongest value of each patch.

Signature
MaxPooling2D -> KerasTensor
    input: KerasTensor
    poolSize: Integer
KerasTensor MaxPooling2D(KerasTensor input, int poolSize = 2)

Parameters

nametypedefaultdescription
inputKerasTensor—The tensor before, shaped height, width, channels.
poolSizeInteger2The patch's width and height.

Returns

TensorKerasTensor
Ships with
Divooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Keras Layers
Package
Machine Learning