/** * @file MlpFactory.hpp * * Creation of initial MLPs based on a simple definition string format. */ #ifndef MLPFACTORY_HPP_ #define MLPFACTORY_HPP_ #include "Mlp.hpp" #include #include #include namespace jymlp{ class MlpFactory{ protected: vector ininneur; vector iniactf; public: MlpFactory() = delete; /** Construct using a definition text stream. * * Format is according to the following example: * * init_size: 2-4-5-2 * init_actf: in-tanh-tanh-lin * init_weights: uniform(-1,1) * * One definition on each line. Obvious modifications are * possible. Default is tanh on hidden layer and linear * activation on output layer. Default initialization is * uniform(-1,1). Number of neurons must always be given. * */ MlpFactory(istream & definition); /** Return a raw ptr to a new Mlp object; use the given rnd generator. */ Mlp *create(mt19937 *prgen); }; } #endif