Description Details Methods Author(s)
R6 class representing a module
R6 class representing a module
A module is a set of graph operation combined together.
new()
It just sets the name of the module
module$new(...)
...
initialisation arguments
name()
Returns the name of the module
module$name()
Returns the name of the module
save()
Saves the module in RDS format
module$save(of, ...)
of
out file name
...
additional arguments to pass to saveRDS
op()
The operator method implements the calculations happeing in the module. This method must be implemented for each object inheriting the class 'module'.
module$op(...)
...
arguments for the calculations
Returns a reference object of class 'number'
obj()
In the case the module represents a full model, the objective method must be implemented. This method method implements the calculations returning the value of the objective function that has to be optimised during the model training. Its first argument must the targets, and its second argument must be the input matrix.
module$obj(...)
...
arguments for the calculations
Returns a reference object of class 'number' of rank 0
pars()
The pars method has to return a flat list containing all the parameters of the module (reference object of class 'number'). This method must be implemented for each object inheriting the class 'module'.
module$pars()
Returns a flat list containing the module parameters (reference object of class 'number')
npars()
This method return the total size of the module parameters,
that is the sum of the sizes of the individual numbers
parameters.
module$npars()
Returns the total number of parameters
y()
Returns the reference object of class 'number' containing the output of the operator method.
module$y()
j()
Returns the reference object of class 'number' containing the output of the objective method.
module$j()
clone()
The objects of this class are cloneable with this method.
module$clone(deep = FALSE)
deep
Whether to make a deep clone.
Filippo Monari
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.