Commit be90a8ff authored by Amelie Royer's avatar Amelie Royer

Update the README for the precision parameter

parent 58082cec
# [memcp] r e a d m e
# [memcp] r e a d m e :panda_face:
#### Installing AIToolBox (AITB)
#### Installing AIToolbox (AITB)
Pre-requisites for AI-Toolbox installation are:
##### 1. Pre-requisites
* GCC 4.9 +
* cmake [``cmake`` package]
* Boost version 1.53+ [``libbost-dev`` package]
* [Eigen 3.2+](http://eigen.tuxfamily.org/index.php?title=Main_Page) library
* [lp_solve](http://lpsolve.sourceforge.net/5.5/) library [``lp-solve`` package]
Once the pre-requisites installed, clone the [AITB repository](https://github.com/Svalorzen/AI-Toolbox), then build it and test the installation with the following commands:
##### 2. Build.
Once the pre-requisites are installed, clone the [AITB repository](https://github.com/Svalorzen/AI-Toolbox), then build it and test the installation with the following commands:
```bash
cd AIToolBox_root
cd AIToolbox_root
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j
ctest -V
```
##### 3. Optional step
(``root`` designates the directory containing this README file).
```bash
cd AIToolbox_root/include/AIToolbox/MDP/
mv SparseModel.hpp SparseModel_backup.hpp
cp root/Code/AiToolBox/SparseModel.hpp SparseModel.hpp
```
This file contains an updated version of the constructor ``SparseModel(model)``, and is identical to the default AITB SparseModel otherwise. In fact, when dealing with the foodmart dataset for large state spaces, the probabilities in the transition function might become very low, which conflicts with the Eigen summation that AIToolbox uses by default in the creation of a SparseModel (approximation error). To prevent this, the new constructor can use *Kahan Summation* by setting the second (optional, defaulting to false) argument to true: ``SparseModel(model, true)``.
#### Generating the data (``Data/`` folder)
......@@ -61,7 +73,7 @@ ctest -V
#### Running the code (``Code/`` folder)
If needed, first set the correct library pathes in ``run.sh``. The script can then be used as follow:
``./run.sh -m [1] -d [2] -n [3] -k [4] -g [5] -s [6] -h [7] -e [8] -x [9] -b [10] -c --help``
``./run.sh -m [1] -d [2] -n [3] -k [4] -g [5] -s [6] -h [7] -e [8] -x [9] -b [10] -c -p --help``
* ``[1]`` Model to use (Defaults to mdp). Available options are *mdp* (MDP model obtained by a weighted average of all the environments' transition probabilities and solved by Value iteration), *ip* (incremental pruning on the MEMDP), *pomcp* and *memcp*.
* ``[2]`` Dataset to use (Defaults to fm). Available options are *fm* (foodmart) and *rd* (synthetic data).
......@@ -73,6 +85,7 @@ If needed, first set the correct library pathes in ``run.sh``. The script can th
* ``[8]`` Convergence criterion for mdp and ip. Defaults to 0.01.
* ``[9]`` Exploration parameter for pomcp and memcp. Defaults to 10000 (high exploration).
* ``[10]`` Number of particles for the belief approximation in pomcp and memcp. Defaults to 100.
* ``[-p]`` If present, use Kahan summation for more precision while handling small probabilities. Use this option if AIToolbox throws an ``Input transition table does not contain valid probabilities`` error when creating the SparseModel object. (*Note*: this requires to use the ``SparseModel.hpp`` file given in ``Code/AiToolBox`` instead of the default AIToolBox one, as described in the first section).
* ``[-c]`` If present, recompile the code before running (*Note*: this should be used whenever using a dataset with different parameters as the number of items, environments etc are determined at compilation time).
**Example** *(foodmart, 6 environments, 3 actions, 13 states)* :
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment