NAME
Peta::NN::Layer::Dense - fully connected layer
VERSION
version 0.2610090
SYNOPSIS
my $net = Peta::NN->new(input => 4, layers => [ [dense => 2] ]); # as one of:
layers => [ [dense => 8], 'relu', [dense => 2] ]
DESCRIPTION
Written as [dense => $outputs] in a network's layer list. The input size comes from the layer before it.
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.
param_cols
param_cols($name): numbers per row of a parameter tensor.
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.