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 
20 namespace mlpack {
21 namespace ann /* Artificial Neural Network */ {
22 namespace augmented /* Augmented neural network */ {
23 namespace tasks /* Task utilities for augmented */ {
24 
42 class AddTask
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
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.
Generator of instances of the binary addition task.
Definition: add.hpp:42
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.
AddTask(const size_t bitLen)
Creates an instance of the binary addition task.