NAME

Peta::NN::Layer::Activation - relu, tanh and sigmoid

VERSION

version 0.2610090

SYNOPSIS

my $net = Peta::NN->new(input => 4, layers => [ [dense => 2] ]);     # as one of:
layers => [ [dense => 8], 'tanh', [dense => 2] ]

DESCRIPTION

Written as the bare string 'relu', 'tanh' or 'sigmoid' in a network's layer list.

METHODS

A layer is made and driven by Peta::NN; these are what the network calls.

new

The layer, from what its entry in the layer list says.

type

The layer's kind, as a model file names it.

init

init($n_in, $rng, $backend): sets the layer up for its input size and returns its output size.

param_names

The names of the layer's parameter tensors.

forward

The layer's output for a batch.

backward

Takes the gradient of the output, leaves the gradients of the parameters with the layer, and returns the gradient of the input.

spec

The layer as it is written in a layer list.

kinds

The activations there are.

AUTHOR

PetaMem s.r.o. <info@petamem.com>

COPYRIGHT

Copyright (c) 2026 PetaMem s.r.o.

LICENSE

This package is free software, dual-licensed under the Artistic License 2.0 and the BSD 2-Clause License. See the LICENSE file of the distribution.