R6 class representing a fully connected layer.
R6 class representing a fully connected layer.
modello::module -> module.fc
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)
module.fc$new(tx, nin, nout, act)
txif TRUE it traspose the input matrix
ninnumber of column of the input matrix
noutnumber of hidden units
actactivation function to adopt
Returns the total number of parameters
op()Performs: ans = act(W.op(X) + B)
module.fc$op(X)
Xinput matrix, reference object of class 'number'
Returns a reference object of class 'number'
pars()Returns the parameters of the module as list with entries: W = weight matrix, and B = bias matrix
module.fc$pars()
Returns a flat list with the parametrs of the module
clone()The objects of this class are cloneable with this method.
module.fc$clone(deep = FALSE)
deepWhether to make a deep clone.