Activation

  • namespace: Rindow\NeuralNetworks\Layer
  • classname: Activation

Applies an activation function to an output.

Methods

constructor

$builer->Activation(
    string|object $activation,
    array $input_shape=null,
    string $name=null,
)

You can create a Activation layer instances with the Layer Builder.

Argument

  • activation: Strings and activation function object instances are allowed as arguments. ‘sigmoid’,’softmax’, ‘relu’, ‘tanh’, ‘linear’.

Options

  • input_shape: Tell the first layer the shape of the input data. In input_shape, the batch dimension is not included.

Examples

$model->add($nn->layers()->Activation('softmax'));