README.md
1# Self-Organizing Map (SOM) sample
2The Self-Organizing Map demonstrates `oneapi::tbb::flow` and the use of cancellation in scheduling multiple iterations of map updates.
3
4For tutorials on Self-organizing Maps, see [here](http://www.ai-junkie.com/ann/som/som1.html) and [here](http://davis.wpi.edu/~matt/courses/soms/).
5
6The program trains the map with several examples, splitting the map into subsections and looking for best-match for multiple examples. When an example is used to update the map, the graphs examining the sections being updated for the next example are cancelled and restarted after the update.
7
8## Building the example
9```
10cmake <path_to_example>
11cmake --build .
12```
13
14## Running the sample
15### Predefined make targets
16* `make run_som` - executes the example with predefined parameters.
17* `make light_test_som` - executes the example with suggested parameters to reduce execution time.
18
19### Application parameters
20Usage:
21```
22som [n-of-threads=value] [radius-fraction=value] [number-of-epochs=value] [cancel-test] [debug] [nospeculate] [-h] [n-of-threads [radius-fraction [number-of-epochs]]]
23```
24* `-h` - prints the help for command line options.
25* `n-of-threads` - number of threads to use; a range of the form low\[:high\], where low and optional high are non-negative integers or `auto` for the oneTBB default.
26* `radius-fraction` - size of radius at which to start speculating.
27* `number-of-epochs` - number of examples used in learning phase.
28* `cancel-test` - test for cancel signal while finding BMU.
29* `debug` - additional output.
30* `nospeculate` - don't speculate in SOM map teaching.
31