25 namespace learningmachine {
38 if(config.find(
"dom").isInt32()) {
43 if(config.find(
"cod").isInt32()) {
52 return (input.size() == this->getDomainSize());
56 return (output.size() == this->getCoDomainSize());
61 throw std::runtime_error(
"Input sample has invalid dimensionality");
64 throw std::runtime_error(
"Output sample has invalid dimensionality");
79 std::ostringstream buffer;
81 buffer <<
"Domain size: " << this->
getDomainSize() << std::endl;
87 std::ostringstream buffer;
89 buffer <<
" dom size Domain size" << std::endl;
90 buffer <<
" cod size Codomain size" << std::endl;
virtual void writeBottle(yarp::os::Bottle &bot) const
Writes a serialization of the machine into a bottle.
virtual void feedSample(const yarp::sig::Vector &input, const yarp::sig::Vector &output)
Provide the learning machine with an example of the desired mapping.
virtual void readBottle(yarp::os::Bottle &bot)
Unserializes a machine from a bottle.
virtual void train()
Train the learning machine on the examples that have been supplied so far.
virtual bool checkDomainSize(const yarp::sig::Vector &input)
Checks whether the input is of the desired dimensionality.
unsigned int getCoDomainSize() const
Returns the size (dimensionality) of the output domain (codomain).
virtual std::string getInfo()
Asks the learning machine to return a string containing information on its operation so far.
virtual void setCoDomainSize(unsigned int size)
Mutator for the codomain size.
virtual bool configure(yarp::os::Searchable &config)
Change parameters.
virtual void setDomainSize(unsigned int size)
Mutator for the domain size.
virtual std::string getConfigHelp()
Asks the learning machine to return a string containing the list of configuration options that it sup...
void validateDomainSizes(const yarp::sig::Vector &input, const yarp::sig::Vector &output)
Validates whether the input and output are of the desired dimensionality.
virtual bool checkCoDomainSize(const yarp::sig::Vector &output)
Checks whether the output is of the desired dimensionality.
unsigned int getDomainSize() const
Returns the size (dimensionality) of the input domain.
virtual std::string getConfigHelp()
Asks the learning machine to return a string containing the list of configuration options that it sup...
virtual std::string getInfo()
Asks the learning machine to return a string containing information on its operation so far.
This file contains the definition of unique IDs for the body parts and the skin parts of the robot.