diff --git a/MLP/include/MLP.hpp b/MLP/include/MLP.hpp index b4f102ae90e6f435d2b68a6b3fe37b88b6aae35f..e0637b9cee0bec98bdd9aff44c0e1332da1deddb 100644 --- a/MLP/include/MLP.hpp +++ b/MLP/include/MLP.hpp @@ -14,6 +14,7 @@ #include "FeatureModel.hpp" /// @brief Multi Layer Perceptron. +/// /// It is capable of training itself given a batch of examples.\n /// Once trained, it can also be used to predict the class of a certain input. class MLP @@ -135,35 +136,42 @@ class MLP /// @param output Where the parameters will be printed to. void printParameters(FILE * output); /// @brief Save the structure of the MLP (all the Layer) to a file. + /// /// The goal is to store the structure of the MLP into a file so that /// we can load it and use it another time. /// @param filename The file in which the structure will be saved. void saveStruct(const std::string & filename); /// @brief Save the learned parameters of the MLP to a file. + /// /// Only the parameters of the Layers will be saved by this function.\n /// The parameters that are values inside of Dict, will be saved by their owner, /// the Dict object. /// @param filename The file in which the parameters will be saved. void saveParameters(const std::string & filename); /// @brief Load and construt all the Layer from a file. + /// /// The file must have been written by the function saveStruct. /// @param filename The file from which the structure will be read. void loadStruct(const std::string & filename); /// @brief Load and populate the model with parameters from a file. + /// /// The file must have been written by the function saveParameters. /// @param filename The file from which the parameters will be read. void loadParameters(const std::string & filename); /// @brief Load a MLP from a file. + /// /// This function will use loadStruct and loadParameters. /// @param filename The file from which the MLP will be loaded. void load(const std::string & filename); /// @brief Initialize the dynet library. + /// /// Must be called only once, and before any call to dynet functions. void initDynet(); public : /// @brief Construct a new untrained MLP from a desired topology. + /// /// topology example for 2 hidden layers : (150,RELU,0.3)(50,ELU,0.2)\n /// Of sizes 150 and 50, activation functions RELU and ELU, and dropout rates /// of 0.3 and 0.2. @@ -172,6 +180,7 @@ class MLP /// @param nbOutputs The size of the output layer of the MLP. MLP(int nbInputs, const std::string & topology, int nbOutputs); /// @brief Read and construct a trained MLP from a file. + /// /// The file must have been written by save. /// @param filename The file to read the MLP from. MLP(const std::string & filename); @@ -183,6 +192,7 @@ class MLP std::vector<float> predict(FeatureModel::FeatureDescription & fd); /// @brief Train the MLP on a batch of training examples. + /// /// The parameters will be updated by this function. /// @param examples A set of training examples. /// @param start The index of the first element of the batch. @@ -191,6 +201,7 @@ class MLP /// @return The number of examples for which the class was correctly predicted by the MLP. int trainOnBatch(Examples & examples, int start, int end); /// @brief Get the score of the MLP on a batch of training examples. + /// /// The parameters will not be updated by this function. /// @param examples A set of training examples. /// @param start The index of the first element of the batch. diff --git a/decoder/include/Decoder.hpp b/decoder/include/Decoder.hpp index b36221191b2bf39cd22f4c75ed19ce096679af7c..228a87514b3113f2ed877c89cf24d3440af49f87 100644 --- a/decoder/include/Decoder.hpp +++ b/decoder/include/Decoder.hpp @@ -25,6 +25,7 @@ class Decoder public : /// @brief Use tm to fill bd. + /// /// At the start of the function, bd must contain the input.\n /// At the end of the function, bd will be terminal. /// @param tm The trained TapeMachine diff --git a/docs/config b/docs/config index f1f319491ee00fbb426379d089523b5d28dc57dd..eb9247cc3e0dbaded4474ec42931e9a2a273d507 100644 --- a/docs/config +++ b/docs/config @@ -1160,7 +1160,7 @@ HTML_FOOTER = # obsolete. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_STYLESHEET = ../docs/doxygen.css +HTML_STYLESHEET = docs/doxygen.css # The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined # cascading style sheets that are included after the standard style sheets diff --git a/maca_common/include/Dict.hpp b/maca_common/include/Dict.hpp index 305b0b73f70683a50a20f6ab40fafe5cdbd41525..871f199a26280c923bfc3d877a3dc75cc67f598e 100644 --- a/maca_common/include/Dict.hpp +++ b/maca_common/include/Dict.hpp @@ -50,6 +50,7 @@ class Dict }; /// @brief The name of this Dict. + /// /// As it appears in the .dict file. std::string name; /// @brief The Mode of this Dict. @@ -60,9 +61,11 @@ class Dict public : /// @brief When a feature value makes no sense (e.g. the fourth letter of 'He') + /// /// it is mapped to this string. static std::string nullValueStr; /// @brief When a feature value is unknown to this Dict, and this Dict is Final + /// /// it is mapped to this string. static std::string unknownValueStr; @@ -101,13 +104,16 @@ class Dict /// @brief FastText object containing pre-trained embeddings, can be empty if we're not using FastText. std::unique_ptr<fasttext::FastText> ftEmbeddings; /// @brief A real vector. + /// /// This is used by FastText to load its pre-trained word embeddings. std::unique_ptr<fasttext::Vector> ftVector; /// @brief This is where we store FastText's pre-trained word embeddings. + /// /// We need this to be able to update embeddings values in the training step. std::map< std::string, std::vector<float> > ftVocab; /// @brief Where all the Dict objects must be stored. + /// /// When getDict is called it will find the requested Dict here, /// or construct it. static std::map< std::string, std::unique_ptr<Dict> > str2dict; @@ -121,11 +127,13 @@ class Dict /// @return The FastText's pre-trained word embedding value corresponding to s. std::vector<float> * getValueFasttext(const std::string & s); /// @brief Initialize a new embedding for this Dict. + /// /// This function zero-initialize the embedding. /// @param s The entry whose embedding we will initialize. /// @param vec The vector containing the embedding we will initialize. void initEmbedding(const std::string & s, std::vector<float> & vec); /// @brief Randomly initialize a new embedding for this Dict. + /// /// Each float value of vec will be randomly set between -1.0 and +1.0 /// @param vec The vector containing the embedding we will initialize. void initEmbeddingRandom(std::vector<float> & vec); @@ -153,6 +161,7 @@ class Dict /// @param mode The Mode of the new Dict. Dict(const std::string & name, int dimension, Mode mode); /// @brief Get a pointer to the entry matching s. + /// /// This is used when we need a permanent pointer to a string matching s, /// but s has a limited lifespan (probably because it was stack allocated).\n /// If no corresponding entry exists, a new one will be added.\n @@ -165,6 +174,7 @@ class Dict public : /// @brief Get a pointer to a Dict. + /// /// If the Dict doesn't exist, it will be constructed. /// @param policy The policy of the Dict. /// @param filename The filename of the Dict. @@ -172,6 +182,7 @@ class Dict /// @return A pointer to the corresponding Dict. static Dict * getDict(Policy policy, const std::string & filename); /// @brief Get a pointer to a Dict. + /// /// If the Dict doesn't exist, the program will abort. /// @param name The name of the Dict. /// @@ -196,6 +207,7 @@ class Dict /// @return The vector value corresponding to s. std::vector<float> * getValue(const std::string & s); /// @brief Get a pointer to the entry matching s. + /// /// This is used when we need a permanent pointer to a string matching s, /// but s has a limited lifespan (probably because it was stack allocated).\n /// If no corresponding entry exists, a new one will be added. diff --git a/maca_common/include/File.hpp b/maca_common/include/File.hpp index e6032cf721cede9b5ecff7c62d6e0d5388e17b96..b804309de884594bc57beeb6a983d528c2cbb97b 100644 --- a/maca_common/include/File.hpp +++ b/maca_common/include/File.hpp @@ -75,12 +75,14 @@ class File /// @return The next char in the file. char getChar(); /// @brief Put back a char in the File. + /// /// It is not mandatory to use a char that was read from the file.\n /// The next call to getChar will return c.\n /// You can call ungetChar successively without problem. /// @param c The char that will be pulled back. void ungetChar(char c); /// @brief Return the underlying file descriptor. + /// /// This is usefull if you need to use fscanf or fprintf. /// @return The file descriptor. FILE * getDescriptor(); @@ -89,14 +91,17 @@ class File /// @return The filename. const std::string & getName(); /// @brief Read the file until the character c is met. + /// /// The next call to getChar will return c. /// @param c The character to read until. void readUntil(char c); /// @brief Read the file until the current character meets a condition. + /// /// The next call to condition(getChar()) will return true. /// @param condition The condition the read char will have to meet. void readUntil(const std::function<bool(char)> & condition); /// @brief Read the file until the current character meets a condition. + /// /// The next call to condition(getChar()) will return true. /// @param dest Where to store all the read characters. /// @param condition The condition the read char will have to meet. diff --git a/tape_machine/include/Action.hpp b/tape_machine/include/Action.hpp index 3ae00b1afc43b6c42f37e5d14823d5f3598b1426..06587bf52d80b8bdb8fe420a9018e195e2714449 100644 --- a/tape_machine/include/Action.hpp +++ b/tape_machine/include/Action.hpp @@ -10,6 +10,7 @@ #include "Config.hpp" /// @brief An Action is a function that transforms a Config. +/// /// More precisely it is a sequence of BasicAction.\n /// It is also possible to undo any action that have been applied to a Config. class Action @@ -19,7 +20,8 @@ class Action /// @brief A BasicAction is an invertible function that transforms a Config. struct BasicAction { - /// @brief How the BasicAction will act on the Config. + /// @brief How the BasicAction will act on the Config. + /// /// Push means to add an element to the Config stack.\n /// Pop means to remove the top element of the Config stack.\n /// Write means to write a string to a Config's buffer cell. @@ -33,6 +35,7 @@ class Action /// @brief The type of this BasicAction. Type type; /// @brief Some memory to remember what data have been erased from the Config. + /// /// This is useful when a BasicAction of type Pop needs to be reverted. std::string data; @@ -55,12 +58,14 @@ class Action /// @brief The name of this Action. std::string name; /// @brief The start of the name of this Action. + /// /// This is useful to maintain a history of past actions, keeping only the type of the actions. std::string namePrefix; public : /// @brief Construct an Action given its name. + /// /// This function will use ActionBank to retrieve the sequence of BasicAction. /// @param name The name of this action. Action(const std::string & name); @@ -73,6 +78,7 @@ class Action /// @param config The Configuration to restore. void undo(Config & config); /// @brief Revert the changes made by this Action on the stack of the Configuration. + /// /// This is useful when doing a backtrack. The stack needs to be restored but the buffer have to keep the values predicted 'in the future'. /// @param config The Configuration to restore. void undoOnlyStack(Config & config); diff --git a/tape_machine/include/ActionBank.hpp b/tape_machine/include/ActionBank.hpp index 6bc957ea68940f862546e5b1d8fa540afd19d940..086940dbd2d775000249a1ab04021ec681a57903 100644 --- a/tape_machine/include/ActionBank.hpp +++ b/tape_machine/include/ActionBank.hpp @@ -9,6 +9,7 @@ #include "Action.hpp" /// @brief Retrieve a sequence of BasicAction from an action name. +/// /// The purpose of this class is to parse an action name and use it to construct /// the corresponding sequence of BasicAction.\n /// The caller will then probably use this sequence of BasicAction to create an Action. @@ -17,6 +18,7 @@ class ActionBank public : /// @brief Construct a sequence of BasicAction from an action name. + /// /// The creation is done dynamically, and if the name given is not correct, /// the program will abort. /// @param name The name of the action (e.g. 'WRITE 0 POS adj'). @@ -27,6 +29,7 @@ class ActionBank private : /// @brief Write a string into a specific cell of the multi-tapes buffer. + /// /// This is a helper function that helps construct BasicAction. /// @param config The Config which buffer will be written into. /// @param tapeName The name of the tape of the buffer that will be written into. @@ -36,6 +39,7 @@ class ActionBank const std::string & value, int relativeIndex); /// @brief Whether or not a call to simpleBufferWrite is possible. + /// /// This is a helper function that helps construct BasicAction. /// @param config The Config simpleBufferWrite would be called with. /// @param tapeName The name of the tape simpleBufferWrite would be called with. @@ -46,6 +50,7 @@ class ActionBank const std::string & tapeName, int relativeIndex); /// @brief Apply a transformation rule to a copy of a multi-tapes buffer cell, and write the result in another cell. + /// /// A rule is in the form '\@er\@w' which in this case means 'remove er suffix and add w suffix' /// @param config The Config which buffer will be written into. /// @param fromTapeName The name of the buffer's tape containing the string to copy and transform. diff --git a/tape_machine/include/ActionSet.hpp b/tape_machine/include/ActionSet.hpp index e94dc9492cfd075fd9c33ab909f7895de0823068..1d611115ba96277157a543411705fb5cb18a45a7 100644 --- a/tape_machine/include/ActionSet.hpp +++ b/tape_machine/include/ActionSet.hpp @@ -10,6 +10,7 @@ #include "Action.hpp" /// @brief A set of Action. +/// /// Each Classifier has an ActionSet, it represents the Action that the Classifier is able to predict. class ActionSet { @@ -22,10 +23,12 @@ class ActionSet /// @brief Map action's name to their index inside the vector actions. std::map<std::string, int> str2index; /// @brief Whether or not this ActionSet is dynamic. + /// /// When an ActionSet is dynamic, new Action can be added to it at any time.\n /// A Classifier of type Prediction cannot have a dynamic ActionSet. bool isDynamic; /// @brief Whether or not this ActionSet have a default action. + /// /// If it is the case, the default action is the first element of the vector actions.\n When getAction is called with an unknown name, the default action is returned.\n If an ActionSet is dynamic, it cannot have a default action. bool hasDefaultAction; @@ -41,12 +44,14 @@ class ActionSet /// @param output Where to print. void printForDebug(FILE * output); /// @brief Get the index of an action given its name. + /// /// This is useful to map each action to an integer, this integer will be the index of the corresponding output neuron of the neural network of the Classifier. /// @param name The name of the Action. /// /// @return The index of the Action in the vector actions. int getActionIndex(const std::string & name); /// @brief Get the name of the Action given its index. + /// /// This is useful to map each action to an integer, this integer will be the index of the corresponding output neuron of the neural network of the Classifier. /// @param actionIndex The index of the Action in the vector actions. /// diff --git a/tape_machine/include/BD.hpp b/tape_machine/include/BD.hpp index aa7178306b56ef40690e47973e7a36cb129f6629..74a516f8b001d4707cb6236b0eb8b11677fd777e 100644 --- a/tape_machine/include/BD.hpp +++ b/tape_machine/include/BD.hpp @@ -11,6 +11,7 @@ #include "Dict.hpp" /// @brief This class contains the description of a buffer and of a MCD. +/// /// It is created by reading a .bd and a .mcd file.\n /// It is used to construct the Config. class BD @@ -25,11 +26,13 @@ class BD /// @brief The Dict containing the vocabulary of strings that can be written on this Line. Dict * dict; /// @brief The column of the MCD this Line corresponds to. + /// /// This can be -1 if the Line corresponds to nothing in the MCD. int inputColumn; /// @brief Whether or not this Line is part of the expected output of the program. bool mustPrint; /// @brief Whether or not the entirety of this Line is already known. + /// /// If this Line's values don't need to be predicted. bool isKnown; diff --git a/tape_machine/include/Classifier.hpp b/tape_machine/include/Classifier.hpp index f8a598bcf456b5cb675f11259047cc6e43a9fc4c..dce07cd3b62e74e44d430269b47257c6a3194071 100644 --- a/tape_machine/include/Classifier.hpp +++ b/tape_machine/include/Classifier.hpp @@ -22,6 +22,7 @@ class Classifier using WeightedActions = std::vector< std::pair<float, std::string> >; /// @brief There are 3 types of Classifier. + /// /// Prediction : Given a Configuration, this Classifier will predict a weight for each element of its ActionSet. This kind of Classifier must be trained beforehand.\n /// Information : Given a Configuration, this Classifier will give the correct Action of its ActionSet to apply. This is useful if you want to build a Classifier that is adding some information to your input. For instance add the lemma of each word, from a file containing every pair of word/lemma.\n /// Forced : This kind of Classifier will always give the same Action. This can be used to force a certain Action to be applied. @@ -40,6 +41,7 @@ class Classifier /// @brief The type of this Classifier. Type type; /// @brief Whether or not the program is in train mode. + /// /// In train mode, the underlying neural network's parameters will be zero-initialized, instead of being read from a file. bool trainMode; /// @brief The FeatureModel of this Classifier. @@ -52,6 +54,7 @@ class Classifier /// @brief A string describing the topology of the underlying neural network. std::string topology; /// @brief The oracle being used by this Classifier. + /// /// For Classifier of type Prediction, the Oracle is used in train mode, to find /// the correct Action to associate with a training example.\n /// For Classifier of type Information, the Oracle is used in train mode and decode mode too, it is simply a deterministic function that gives the correct Action given a Configuration. @@ -67,6 +70,7 @@ class Classifier static void printWeightedActions(FILE * output, WeightedActions & wa, int threshold = 5); /// @brief Convert a string to its corresponding Type. + /// /// If s is unknown, the program aborts. /// @param s The string to convert. /// @@ -111,6 +115,7 @@ class Classifier /// @return The number of examples correctly classified by this Classifier. int getScoreOnBatch(MLP::Examples & examples, int start, int end); /// @brief Train this Classifier with a batch of training examples. + /// /// This function is similar to getScoreOnBatch, except that it update the neural network parameters in order to fit the batch examples more. /// @param examples A set of training examples. /// @param start The index of the start of the batch. @@ -119,6 +124,7 @@ class Classifier /// @return The number of examples correctly classified by this Classifier. int trainOnBatch(MLP::Examples & examples, int start, int end); /// @brief Get the name of an Action from its index. + /// /// The index of an Action can be seen as the index of the corresponding output neuron in the underlying neural network. /// @param actionIndex The index of the Action. /// @@ -131,6 +137,7 @@ class Classifier /// @return A pointer to the Action. Action * getAction(const std::string & name); /// @brief Initialize the underlying neural network. + /// /// Using the Config and the FeatureModel, the size of the input and output layers of the neural network will be computed. Using the topology string, the hidden layers will be computed. /// @param config A Configuration of the TapeMachine. void initClassifier(Config & config); @@ -139,6 +146,7 @@ class Classifier /// @param modelFilename The name of the file to write to. void save(const std::string & modelFilename); /// @brief Whether or not this Classifier needs to be trained. + /// /// The only type of Classifier that needs to be tained is Prediction. /// @return Whether or not this Classifier needs to be trained. bool needsTrain(); diff --git a/tape_machine/include/Config.hpp b/tape_machine/include/Config.hpp index e7d4d8a190064f903cb04a5e9a7a925ebfaf131c..7dbb45a35cf149b4edd9dccc6fd15d9f5e11a449 100644 --- a/tape_machine/include/Config.hpp +++ b/tape_machine/include/Config.hpp @@ -16,6 +16,7 @@ class Config public : /// @brief A Tape of the multi-tapes buffer. + /// /// Each cell can contain a string. struct Tape { @@ -29,6 +30,7 @@ class Config /// @brief Content of the cells of this Tape, which have been predicted by the program so far. std::vector<std::string> hyp; /// @brief Access the value of a cell. + /// /// If isKnown is true, the vector ref will be read, otherwise the vector hyp will be read. /// @param index Index of the cell to access. /// @@ -94,6 +96,7 @@ class Config /// @param mvt The relative increment in the position of the head. void moveHead(int mvt); /// @brief Whether or not this Config is terminal. + /// /// A Config is terminal when the head is at the end of the multi-tapes buffer and the stack is empty. /// @return Whether or not this Config is terminal. bool isFinal(); @@ -104,11 +107,13 @@ class Config /// @return the name of the current state in the TapeMachine. std::string & getCurrentStateName(); /// @brief Set the name of the current state in the TapeMachine. + /// /// This function does not change the current state in the TapeMachine.\n /// But it has to be called everytime the TapeMachine's current state change, in order to notify the Config of this change. /// @param name The name of the current state in the TapeMachine. void setCurrentStateName(std::string * const name); /// @brief Get the history of Action of the current state in the TapeMachine. + /// /// @return The history of Action of the current state in the TapeMachine. std::vector<std::string> & getCurrentStateHistory(); }; diff --git a/tape_machine/include/FeatureBank.hpp b/tape_machine/include/FeatureBank.hpp index 81dbf03f9a5798eaf7a181d413b213f2c77416db..a111cd85fa77aa242a2167e4920a8db559492518 100644 --- a/tape_machine/include/FeatureBank.hpp +++ b/tape_machine/include/FeatureBank.hpp @@ -10,6 +10,7 @@ #include "FeatureModel.hpp" /// @brief This class is able to create feature functions from a feature name. +/// /// It is used to construct FeatureModel. class FeatureBank { @@ -25,6 +26,7 @@ class FeatureBank private : /// @brief Converts a Dict policy to a Feature policy. + /// /// The purpose of the Feature policy is to state that if a Dict is Final, its values will not be updated during the training step. /// @param policy The policy of the Dict. /// diff --git a/tape_machine/include/FeatureModel.hpp b/tape_machine/include/FeatureModel.hpp index 07a48bc00e932160c35640ca765bc51f5a7ef6e2..13bd9aa9cc3056a16f73b7cd36076936ae413a1e 100644 --- a/tape_machine/include/FeatureModel.hpp +++ b/tape_machine/include/FeatureModel.hpp @@ -11,12 +11,14 @@ #include "Config.hpp" /// @brief A FeatureModel is a set of features, used by a specific Classifier. +/// /// It can be seen as a function that can break any Configuration into a FeatureDescription (a vector of real values that can be used as an input of a neural network). class FeatureModel { public : /// @brief The Policy of a Feature. + /// /// If a Feature is Modifiable, its value will be updated during the training step. It will not if it's Final. enum Policy { @@ -62,6 +64,7 @@ class FeatureModel std::function<FeatureValue(Config &)> func; /// @brief Construct a new Feature by parsing a feature name. + /// /// This function will uses the helper class FeatureBank. /// @param name The feature name. Feature(const std::string & name); diff --git a/tape_machine/include/Oracle.hpp b/tape_machine/include/Oracle.hpp index 5ac85c55568f51ff2cbc0e5c9417317c577d21af..a3353d70c12a374c5fb42f51598b878810e75111 100644 --- a/tape_machine/include/Oracle.hpp +++ b/tape_machine/include/Oracle.hpp @@ -36,21 +36,25 @@ class Oracle /// @brief Whether or not initialize have been called. bool isInit; /// @brief A filename. + /// /// An Oracle can have a file. This file can be read during the initialize function to help the Oracle in its future calls to findAction. For instance the file can be a list of pairs of word / lemma, that can help the Oracle predict the lemmatization action. std::string filename; /// @brief Some data that can help the Oracle. + /// /// The Oracle can fill this data structure in the function initialize, and uses its content in the function findAction. std::map<std::string, std::string> data; public : /// @brief Get an Oracle from its name. + /// /// If the name is unknown, the program aborts. /// @param name The name of the Oracle. /// /// @return A pointer to the Oracle object. static Oracle * getOracle(const std::string & name); /// @brief Get an Oracle from its name. + /// /// If the name is unknown, the program aborts. /// @param name The name of the Oracle. /// @param filename The name of the file the oracle can use. diff --git a/tape_machine/include/TapeMachine.hpp b/tape_machine/include/TapeMachine.hpp index a2e629c54d5d78c0f480579db7b63447fb7ff23c..56bd995045909eb01bc3179d71a9198fdc37e0eb 100644 --- a/tape_machine/include/TapeMachine.hpp +++ b/tape_machine/include/TapeMachine.hpp @@ -9,6 +9,7 @@ #include "Classifier.hpp" /// @brief The purpose of a TapeMachine is to predict a sequence of Action, that will transform an initial Config into a terminal Config. +/// /// The terminal Config will contains more information than the initial one, for /// instance if the initial Config consists of words, the final Config could consist of words + their part of speech tags.\n /// The TapeMachine is made of states, linked together by Transition. Every step is associated with a Classifier.\n diff --git a/trainer/include/Trainer.hpp b/trainer/include/Trainer.hpp index f202b0f84555cdbd8b3edf5846927b3f87314c70..aa00705d4775aa783a70a0d99f46654e60505700 100644 --- a/trainer/include/Trainer.hpp +++ b/trainer/include/Trainer.hpp @@ -28,10 +28,12 @@ class Trainer Config & trainConfig; /// @brief The BD initialized with dev examples. + /// /// Can be nullptr if dev is not used in this training. BD * devBD; /// @brief The configuration of the TapeMachine while processing devBD. - // Can be nullptr if dev is not used in this training. + /// + /// Can be nullptr if dev is not used in this training. Config * devConfig; public : @@ -46,6 +48,7 @@ class Trainer private : /// @brief Train the TapeMachine using batches of examples. + /// /// For each epoch all the Classifier of the TapeMachine are fed all the /// training examples, at the end of the epoch Classifier are evaluated on /// the devBD if available, and each Classifier will be saved only if its score @@ -62,6 +65,7 @@ class Trainer void getExamplesByClassifier(std::map<Classifier*, MLP::Examples> & examples, Config & config); /// @brief Make each Classifier go over every examples. + /// /// Depending on getScoreOnBatch, it can update the parameters or not. /// @param examples Map each trainable Classifier with a set of examples. /// @param batchSize The batch size to use.