Public methods
Method new()
The initialisation method sets the weights (W), the bais (B) matrices,
the objective function (obj), as well as the name of the module.
The calculation performed is the following
ans = softmax(W.op(X) + B)
Usage
module.softmax$new(tx, nin, nout, b = TRUE)
Arguments
tx
if TRUE it traspose the input matrix
nin
number of column of the input matrix
nout
number of outputs
b
if TRUE the intercept term is included
Returns
Returns the total number of parameters
Method op()
Performs: ans = sigmoid(W.op(X) + B)
Usage
module.softmax$op(X)
Arguments
X
input matrix, reference object of class 'number'
Returns
Returns a reference object of class 'number'
Examples
\donttest{
modello.init(10, 10, 10, 10)
X = number(matrix(rnorm(12), 6), dx=FALSE)
mdl = module.softmax$new(1, 2, 3, b=FALSE)
print(X$v)
Yh = mdl$op(X)
print(Yh)
print(Yh$v)
modello.close()
}
Method clone()
The objects of this class are cloneable with this method.
Usage
module.softmax$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.