Machine Learning Module that allows the robot to learn online and predict a one-to-one map.
Machine Learning Module that allows the robot to learn online and predict a one-to-one map.
Description
This module belongs to the suite of KARMA software and is responsible for learning a generic map from to .
Libraries
- YARP libraries.
- learningMachine library.
Parameters
–context context
- To specify the module's context.
–from file
- To specify the module's configuration file.
Ports Created
- /karmaLearn/rpc remote procedure call.
Recognized remote commands:
- [train] "item" <in> <out>: issue the module to train internal machines with the input-output pair for the given item. The reply is [nack]/[ack].
- [predict] "item" <in>: retrieve the predicted output for the specified input. The reply is [nack]/[ack] <out> <variance>, where the variance is meaningful only if not negative. In case the input command is of the form [predict] "item" (<in0> <in1> ...), the prediction is returned for the values contained in the list and the reply will look like ack (<variance0> <variance1> ...).
- [span] "item" <step>: retrieve the predicted output for a given range of input specified by the parameter step. The reply is [nack]/ack (<variance0> <variance1> ...). The second parameter can be omitted and an internal default step size is used.
- [optimize] "item" [<step>]|[(<val0> <val1> ...)]: for the specified item a search with the given step, or alternatively over the given list of input values, is performed in order to find out the input that elicits the maximum output. The reply is [nack]/[ack] <in> <out>. The second parameter can be omitted and an internal default step size is used.
- [items]: retrieve the name of the items currently handled by the module.
- [machine] "item": retrieve the content of the machine contained within the database that serves to represent the input-output relation of the given item.
- [clear] "item": remove the item from the internal machines database. If no argument is given, clean up the whole database content. The reply is [nack]/[ack].
- [save]: save the content of the internal machines database within the configuration file. The reply is [ack].
- [plot] "item" <step>: stream out a yarp image displaying the map learned for the specified item as computed over the domain explored with the given step.
/karmaLearn/plot:o streams out images containing the learned maps.
Configuration Files
The configuration file passed through the option –from looks like as follows:
[general]
name karmaLearn
num_items 0
in_lb 0.0
in_ub 360.0
out_lb 0.0
out_ub 2.0
Moreover, once some learning has been carried out, the configuration file will be filled with the sections corresponding to the items.
Tested OS
Windows, Linux
- Author
- Ugo Pattacini