module.fc: R6 class representing a fully connected layer.

Description Super class Methods Author(s)

Description

R6 class representing a fully connected layer.

R6 class representing a fully connected layer.

Super class

modello::module -> module.fc

Methods

Public methods

Inherited methods

Method new()

The initialisation method sets the weights (W), the bais (B) matrices, the activation function (act), as well as the name of the module. The calculation performed is the following ans = act(W.op(X) + B)

Usage
module.fc$new(tx, nin, nout, act)
Arguments
tx

if TRUE it traspose the input matrix

nin

number of column of the input matrix

nout

number of hidden units

act

activation function to adopt

Returns

Returns the total number of parameters


Method op()

Performs: ans = act(W.op(X) + B)

Usage
module.fc$op(X)
Arguments
X

input matrix, reference object of class 'number'

Returns

Returns a reference object of class 'number'


Method pars()

Returns the parameters of the module as list with entries: W = weight matrix, and B = bias matrix

Usage
module.fc$pars()
Returns

Returns a flat list with the parametrs of the module


Method clone()

The objects of this class are cloneable with this method.

Usage
module.fc$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Author(s)

Filippo Monari


modello documentation built on Feb. 2, 2021, 9:06 a.m.

Related to module.fc in modello...