-
Notifications
You must be signed in to change notification settings - Fork 0
Getting Started on SML
If you're new to Soletta Machine Learning (SML), here are a few steps to create a simple software using its C API.
See Soleta Machine Learning for a introduction to the project and learn a bit about machine learning.
For instructions on how to use machine learning on flows written with Soletta, see How to add machine learning to flows
Start by cloning Soletta Machine Learning git repository:
$ git clone [email protected]:solettaproject/soletta-machine-learning.git
Install the dependencies: fuzzylite, fann and soletta
fuzzylite is fuzzy logic control library written in C++:
- Web site: http://www.fuzzylite.com/
- github: https://github.com/fuzzylite/fuzzylite.git
- you may need to tweak fuzzylite.pc.in a bit (change Cflags: -I${includedir}/fl for Cflags: -I${includedir})
- you may find packages for your distro as well
FANN is a neural network library.
- Web site: http://leenissen.dk/fann/wp/
- github: https://github.com/libfann/fann
- some distros like Fedora, has Fann in its rpm repository.
Soletta is a framework for making IoT devices. Some Soletta's data types are used by SML. Also SML provides a module for Soletta that depends on it.
- Web site: http://solettaproject.org/
- github: https://github.com/solettaproject/soletta
CMake building system is used to build SML, so it's required to install it.
After dependencies are properly installed, it's time to build SML:
$ cd soletta-machine-learning/
$ mkdir build/
$ cd build/
$ cmake ..
$ make
Before start coding, it's a good idea to think about the problem and try to answer a few questions:
- What is it trying to learn?
- What would be the input and output variables?
- What engine is better to this specific problem? See this section to learn about their differences.
- (For fuzzy only) How can these variables change? Take on consideration the type of variables, ranges, how should they be separated on terms.
The SML main flow consist in the following steps:
- Choose an engine (ANN or Fuzzy)
- Create the inputs and outputs variables
- Register the read callback
- Register the change callback
- Read the variable value, set it in SML and call process()
SML supports a lot of customization, even some options specific for each engine.
To learn more about it, check the project's online API
If you prefer, it's possible to build it online
$ cd machine-learning/build/
$ make doc
It depends on Doxygen