Select Git revision
macaon_train.cpp
macaon_train.cpp 11.05 KiB
/// @file macaon_train.cpp
/// @author Franck Dary
/// @version 1.0
/// @date 2018-08-07
#include <cstdio>
#include <cstdlib>
#include <boost/program_options.hpp>
#include "BD.hpp"
#include "Config.hpp"
#include "TransitionMachine.hpp"
#include "Trainer.hpp"
#include "ProgramParameters.hpp"
namespace po = boost::program_options;
/// @brief Get the list of mandatory and optional program arguments.
///
/// @return The lists.
po::options_description getOptionsDescription()
{
po::options_description desc("Command-Line Arguments ");
po::options_description req("Required");
req.add_options()
("expName", po::value<std::string>()->required(),
"Name of this experiment")
("templateName", po::value<std::string>()->required(),
"Name of the template folder")
("tm", po::value<std::string>()->required(),
"File describing the Tape Machine we will train")
("bd", po::value<std::string>()->required(),
"BD file that describes the multi-tapes buffer")
("mcd", po::value<std::string>()->required(),
"MCD file that describes the input")
("train,T", po::value<std::string>()->required(),
"Training corpus formated according to the MCD");
po::options_description opt("Optional");
opt.add_options()
("help,h", "Produce this help message")
("debug,d", "Print infos on stderr")
("optimizer", po::value<std::string>()->default_value("amsgrad"),
"The learning algorithm to use : amsgrad | adam | sgd")
("dev", po::value<std::string>()->default_value(""),
"Development corpus formated according to the MCD")
("lang", po::value<std::string>()->default_value("fr"),
"Language you are working with")
("nbiter,n", po::value<int>()->default_value(5),
"Number of training epochs (iterations)")
("iterationSize", po::value<int>()->default_value(-1),
"The number of examples for each iteration. -1 means the whole training set")
("lr", po::value<float>()->default_value(0.001),
"Learning rate of the optimizer")
("seed,s", po::value<int>()->default_value(100),
"The random seed that will initialize RNG")
("nbTrain", po::value<int>()->default_value(0),
"The number of models that will be trained, with only the random seed changing")
("duplicates", po::value<bool>()->default_value(true),
"Remove identical training examples")
("showFeatureRepresentation", po::value<bool>()->default_value(false),
"For each state of the Config, show its feature representation")
("interactive", po::value<bool>()->default_value(true),
"Is the shell interactive ? Display advancement informations")
("randomEmbeddings", po::value<bool>()->default_value(false),
"When activated, the embeddings will be randomly initialized")
("sequenceDelimiterTape", po::value<std::string>()->default_value("EOS"),
"The name of the buffer's tape that contains the delimiter token for a sequence")
("sequenceDelimiter", po::value<std::string>()->default_value("1"),
"The value of the token that act as a delimiter for sequences")