copy.hpp
Go to the documentation of this file.
1 
14 #ifndef MLPACK_METHODS_AUGMENTED_TASKS_COPY_HPP
15 #define MLPACK_METHODS_AUGMENTED_TASKS_COPY_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 
48 class CopyTask
49 {
50  public:
60  CopyTask(const size_t maxLength,
61  const size_t nRepeats,
62  const bool addSeparator = false);
71  void Generate(arma::field<arma::mat>& input,
72  arma::field<arma::mat>& labels,
73  const size_t batchSize,
74  bool fixedLength = false) const;
75 
84  void Generate(arma::mat& input,
85  arma::mat& labels,
86  const size_t batchSize) const;
87 
88  private:
89  // Maximum length of a sequence.
90  size_t maxLength;
91  // Number of repeats the model has to perform to complete the task.
92  size_t nRepeats;
93  // Flag indicating whether generator should produce
94  // separator as part of the sequence
95  bool addSeparator;
96 };
97 
98 } // namespace tasks
99 } // namespace augmented
100 } // namespace ann
101 } // namespace mlpack
102 
103 #include "copy_impl.hpp"
104 
105 #endif
Linear algebra utility functions, generally performed on matrices or vectors.
void Generate(arma::field< arma::mat > &input, arma::field< arma::mat > &labels, const size_t batchSize, bool fixedLength=false) const
Generate dataset of a given size.
The core includes that mlpack expects; standard C++ includes and Armadillo.
CopyTask(const size_t maxLength, const size_t nRepeats, const bool addSeparator=false)
Creates an instance of the sequence copy task.
Generator of instances of the binary sequence copy task.
Definition: copy.hpp:48