module: R6 class representing a module

Description Details Methods Author(s)

Description

R6 class representing a module

R6 class representing a module

Details

A module is a set of graph operation combined together.

Methods

Public methods


Method new()

It just sets the name of the module

Usage
module$new(...)
Arguments
...

initialisation arguments


Method name()

Returns the name of the module

Usage
module$name()
Returns

Returns the name of the module


Method save()

Saves the module in RDS format

Usage
module$save(of, ...)
Arguments
of

out file name

...

additional arguments to pass to saveRDS


Method op()

The operator method implements the calculations happeing in the module. This method must be implemented for each object inheriting the class 'module'.

Usage
module$op(...)
Arguments
...

arguments for the calculations

Returns

Returns a reference object of class 'number'


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

Usage
module$obj(...)
Arguments
...

arguments for the calculations

Returns

Returns a reference object of class 'number' of rank 0


Method 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'.

Usage
module$pars()
Returns

Returns a flat list containing the module parameters (reference object of class 'number')


Method npars()

This method return the total size of the module parameters, that is the sum of the sizes of the individual numbers parameters.

Usage
module$npars()
Returns

Returns the total number of parameters


Method y()

Returns the reference object of class 'number' containing the output of the operator method.

Usage
module$y()

Method j()

Returns the reference object of class 'number' containing the output of the objective method.

Usage
module$j()

Method clone()

The objects of this class are cloneable with this method.

Usage
module$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 in modello...