Input

class Input(input_size: int)

Bases: bluebird.layers.layer.Layer

Input is the base input type layer, it just passes inputed values to the next layer.

When used in convolutional neural nettworks, input size reprisents the number of input channels.

Input type layer must be the first layer of the network.

Example:

input = Input(50)
net = NeuralNet([
        input,
        ...
    ])
__init__(input_size: int) → None

Initializes the object.

Parameters

input_size (int) – size of inputed Tensor (channels for convolution)

Methods

__init__(input_size)

Initializes the object.

backward(output)

Passes the same Tensor just backwards.

build()

Called by the model, before its training step.

forward(inputs[, training])

Called each time the data passes throughout the nework.

get_params()

Returns params of layer.

backward(output: numpy.ndarray) → numpy.ndarray

Passes the same Tensor just backwards.

Parameters

grad (Tensor) – gradient from previous layer.

Returns

Tensor that it has recived.

Return type

Tensor

build() → None

Called by the model, before its training step.

Prepares the input size for next layer.

forward(inputs: numpy.ndarray, training: bool = False) → numpy.ndarray

Called each time the data passes throughout the nework.

Parameters
  • inputs (Tensor) – input data to the network

  • training (bool, optional) – set to true during training, and is false when network predicts

Returns

Tensor that it has recived

Return type

Tensor

get_params() → Dict

Returns params of layer.

Returns

all params of layer

Return type

dict