mlpack 3.4.2
add.hpp
Go to the documentation of this file.
1
14#ifndef MLPACK_METHODS_AUGMENTED_TASKS_ADD_HPP
15#define MLPACK_METHODS_AUGMENTED_TASKS_ADD_HPP
16
17#include <mlpack/prereqs.hpp>
19
20namespace mlpack {
21namespace ann /* Artificial Neural Network */ {
22namespace augmented /* Augmented neural network */ {
23namespace tasks /* Task utilities for augmented */ {
24
43{
44 public:
50 AddTask(const size_t bitLen);
51
61 void Generate(arma::field<arma::mat>& input,
62 arma::field<arma::mat>& labels,
63 const size_t batchSize,
64 const bool fixedLength = false) const;
65
74 void Generate(arma::mat& input,
75 arma::mat& labels,
76 const size_t batchSize) const;
77
78 private:
79 // Maximum binary length of numbers.
80 size_t bitLen;
81
92 void Binarize(const arma::field<arma::vec>& input,
93 arma::field<arma::mat>& output) const;
94};
95
96} // namespace tasks
97} // namespace augmented
98} // namespace ann
99} // namespace mlpack
100
101#include "add_impl.hpp"
102#endif
Generator of instances of the binary addition task.
Definition: add.hpp:43
AddTask(const size_t bitLen)
Creates an instance of the binary addition task.
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.
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.
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
The core includes that mlpack expects; standard C++ includes and Armadillo.