Learn R Programming

modello (version 0.1.1)

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

Description

R6 class representing a fully connected layer.

R6 class representing a fully connected layer.

Arguments

Super class

modello::module -> module.fc

Methods

Public 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.