mlpack  3.4.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
AddTask Class Reference

Generator of instances of the binary addition task. More...

Public Member Functions

 AddTask (const size_t bitLen)
 Creates an instance of the binary addition task. More...
 
void Generate (arma::field< arma::mat > &input, arma::field< arma::mat > &labels, const size_t batchSize, const bool fixedLength=false) const
 Generate dataset of a given size. More...
 
void Generate (arma::mat &input, arma::mat &labels, const size_t batchSize) const
 Generate dataset of a given size and store it in arma::mat object. More...
 

Detailed Description

Generator of instances of the binary addition task.

The parameters are:

Every element of sequence is encoded as 1-dimensional vector (possible vector elements are {0, 1, 0.5} - the latter corresponds to '+' sign'). Generated datasets are compliant with mlpack format - every dataset element is shaped as a vector of length 3 * (sequence length),

Example of generated dataset (binary length = 2):

Definition at line 42 of file add.hpp.

Constructor & Destructor Documentation

AddTask ( const size_t  bitLen)

Creates an instance of the binary addition task.

Parameters
bitLenMaximum binary length of added numbers.

Member Function Documentation

void Generate ( arma::field< arma::mat > &  input,
arma::field< arma::mat > &  labels,
const size_t  batchSize,
const bool  fixedLength = false 
) const

Generate dataset of a given size.

Parameters
inputThe variable to store input sequences.
labelsThe variable to store output sequences.
batchSizeThe dataset size.
fixedLengthFlag that indicates whether the method should return sequences of even length.
void Generate ( arma::mat &  input,
arma::mat &  labels,
const size_t  batchSize 
) const

Generate dataset of a given size and store it in arma::mat object.

Parameters
inputThe variable to store input sequences.
labelsThe variable to store output sequences.
batchSizeThe dataset size.

The documentation for this class was generated from the following file: