iCub-main
Loading...
Searching...
No Matches
LinearGPRLearner.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2007-2011 RobotCub Consortium, European Commission FP6 Project IST-004370
3 * author: Arjan Gijsberts
4 * email: arjan.gijsberts@iit.it
5 * website: www.robotcub.org
6 * Permission is granted to copy, distribute, and/or modify this program
7 * under the terms of the GNU General Public License, version 2 or any
8 * later version published by the Free Software Foundation.
9 *
10 * A copy of the license can be found at
11 * http://www.robotcub.org/icub/license/gpl.txt
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
16 * Public License for more details
17 */
18
19#ifndef LM_LINEARGPRLEARNER__
20#define LM_LINEARGPRLEARNER__
21
22#include <string>
23#include <vector>
24
25#include <yarp/sig/Matrix.h>
26
28
29
30namespace iCub {
31namespace learningmachine {
32
33
60private:
64 yarp::sig::Matrix R;
65
69 yarp::sig::Matrix B;
70
74 yarp::sig::Matrix W;
75
79 double sigma;
80
84 int sampleCount;
85
86public:
94 LinearGPRLearner(unsigned int dom = 1, unsigned int cod = 1, double sigma = 1.0);
95
100
104 virtual ~LinearGPRLearner();
105
110
111 /*
112 * Inherited from IMachineLearner.
113 */
114 virtual void feedSample(const yarp::sig::Vector& input, const yarp::sig::Vector& output);
115
116 /*
117 * Inherited from IMachineLearner.
118 */
119 virtual void train();
120
121 /*
122 * Inherited from IMachineLearner.
123 */
124 virtual Prediction predict(const yarp::sig::Vector& input);
125
126 /*
127 * Inherited from IMachineLearner.
128 */
129 void reset();
130
131 /*
132 * Inherited from IMachineLearner.
133 */
135 return new LinearGPRLearner(*this);
136 }
137
138 /*
139 * Inherited from IMachineLearner.
140 */
141 virtual std::string getInfo();
142
143 /*
144 * Inherited from IMachineLearner.
145 */
146 virtual std::string getConfigHelp();
147
148 /*
149 * Inherited from IMachineLearner.
150 */
151 virtual void writeBottle(yarp::os::Bottle& bot);
152
153 /*
154 * Inherited from IMachineLearner.
155 */
156 virtual void readBottle(yarp::os::Bottle& bot);
157
158 /*
159 * Inherited from IFixedSizeLearner.
160 */
161 void setDomainSize(unsigned int size);
162
163 /*
164 * Inherited from IFixedSizeLearner.
165 */
166 void setCoDomainSize(unsigned int size);
167
174 void setSigma(double s);
175
181 double getSigma();
182
183 /*
184 * Inherited from IMachineLearner.
185 */
186 virtual bool configure(yarp::os::Searchable& config);
187
188};
189
190} // learningmachine
191} // iCub
192#endif
An generalized interface for a learning machine with a fixed domain and codomain size.
Standard linear Bayesian regression or, equivalently, Gaussian Process Regression with a linear covar...
virtual Prediction predict(const yarp::sig::Vector &input)
Ask the learning machine to predict the output for a given input.
virtual void readBottle(yarp::os::Bottle &bot)
Unserializes a machine from a bottle.
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.
LinearGPRLearner & operator=(const LinearGPRLearner &other)
Assignment operator.
double getSigma()
Accessor for the signal noise \sigma.
void setSigma(double s)
Sets the signal noise \sigma to a specified value.
virtual bool configure(yarp::os::Searchable &config)
Change parameters.
LinearGPRLearner * clone()
Asks the learning machine to return a clone of its type.
virtual void train()
Train the learning machine on the examples that have been supplied so far.
virtual void writeBottle(yarp::os::Bottle &bot)
void setCoDomainSize(unsigned int size)
Mutator for the codomain size.
void setDomainSize(unsigned int size)
Mutator for the domain size.
virtual void feedSample(const yarp::sig::Vector &input, const yarp::sig::Vector &output)
Provide the learning machine with an example of the desired mapping.
void reset()
Forget everything and start over.
A class that represents a prediction result.
Definition Prediction.h:44
This file contains the definition of unique IDs for the body parts and the skin parts of the robot.