-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added another example for the tutoiral, and made a corresponding test. Fixed bug with reading matlab files for plots. Changed some keywords to do with file_types and files. Moved version to 2.0.1
- Loading branch information
1 parent
83d81f3
commit ef86872
Showing
25 changed files
with
422 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
.. _api-controllers: | ||
|
||
controllers | ||
----------- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
.. _sec-api: | ||
|
||
M-LOOP API | ||
========== | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
.. _api-learners: | ||
|
||
learners | ||
--------- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.. _sec-contributing: | ||
|
||
Contributing | ||
============ | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
.. _sec-data: | ||
|
||
Data | ||
==== | ||
|
||
M-LOOP saves all data produced by the experiment in archives which are saved to disk during and after the optimization run. The archives also contain information derived from the data, including the machine learning model for how the experiment works. Here we explain how to interpret the file archives. | ||
|
||
File Formats | ||
------------ | ||
|
||
M-LOOP currently supports three file formats for all file input and output. | ||
|
||
- 'txt' text files: Human readable text files. This is the default file format for all outputs. The advantage of text files is they are easy to read, and there will be no format compatibility issues in the future. However, there will be some loss of precision in your data. To ensure you keep all significant figure you may want to use 'pkl' or 'mat'. | ||
- 'mat' MATLAB files: Matlab files that can be opened and written with MATLAB or `numpy <http://www.numpy.org/>`_. | ||
- 'pkl' pickle files: a serialization of a python dictionary made with `pickle <https://docs.python.org/3/library/pickle.html>`. Your data can be retrieved from this dictionary using the appropriate keywords. | ||
|
||
File Keywords | ||
------------- | ||
|
||
The archives contain a set of keywords/variable names with associated data. The quickest way to understand what the values mean for a particular keyword is to :ref:`search` the documentation for a description. | ||
|
||
For a comprehensive list of all the keywords looks at the attributes described in the API. | ||
|
||
For the controller archive see :ref:`api-controllers`. | ||
|
||
For the learner archive see :ref:`api-learners`. The generic keywords are described in the class Learner, with learner specific options described in the derived classes, for example GaussianProcessLearner. | ||
|
||
Converting files | ||
---------------- | ||
|
||
If for whatever reason you want to convert files between the formats you can do so using the utilities module of M-LOOP. For example the following python code will convert the file controller_archive_2016-08-18_12-18.pkl from a 'pkl' file to a 'mat' file:: | ||
|
||
import mloop.utilities as mlu | ||
|
||
saved_dict = mlu.get_dict_from_file('./M-LOOP_archives/controller_archive_2016-08-18_12-18.pkl','pkl') | ||
mlu.save_dict_to_file(saved_dict,'./M-LOOP_archives/controller_archive_2016-08-18_12-18.mat','mat') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
.. _sec-examples: | ||
|
||
Examples | ||
-------- | ||
I like turtles side 8 | ||
======== | ||
|
||
Blah |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
.. _sec-interfaces: | ||
|
||
Interfaces | ||
========== | ||
|
||
Currently M-LOOP only support the File interface, which is also described in :ref:`sec-tutorial`. There will be more added very soon. If you have any suggestions for interfaces please consider :ref:`sec-contributing` to the project. | ||
|
||
File Interface | ||
-------------- | ||
|
||
The simplest method to connect your experiment to M-LOOP is with the file interface where data is exchanged by writing files to disk. To use this interface you can include the option:: | ||
|
||
interface='file' | ||
in you configuration file. The file interface happens to be the default, so this is not necessary. | ||
|
||
The file interface works under the assumption that you experiment follows the following algorithm. | ||
|
||
1. Wait for the file *exp_input.txt* to be made on the disk in the same folder M-LOOP is run. | ||
2. Read the parameters for the next experiment from the file (named params). | ||
3. Delete the file *exp_input.txt*. | ||
4. Run the experiment with the parameters provided and calculate a cost, and optionally the uncertainty. | ||
5. Write the cost to the file *exp_output.txt*. Go back to step 1. | ||
|
||
It is important you delete the file *exp_input.txt* after reading it, since it is used to as an indicator for the next experiment to run. | ||
|
||
When writing the file *exp_output.txt* there are three keywords and values you can include in your file, for example after the first run your experiment may produce the following:: | ||
|
||
cost = 0.5 | ||
uncer = 0.01 | ||
bad = false | ||
|
||
cost refers to the cost calculated from the experimental data. uncer, is optional, and refers to the uncertainty in the cost measurement made. Note, M-LOOP by default assumes there is some noise corrupting costs, which is fitted and compensated for. Hence, if there is some noise in your costs which you are unable to predict from a single measurement, do not worry, you do not have to estimate uncer, you can just leave it out. Lastly bad can be used to indicate an experiment failed and was not able to produce a cost. If the experiment worked set bad = false and if it failed set bad = true. | ||
|
||
Note you do not have to include all of the keywords, you must provide at least a cost or the bad keyword set to false. For example a succesful run can simply be:: | ||
|
||
cost = 0.3 | ||
and failed experiment can be as simple as:: | ||
|
||
bad = True | ||
Once the *exp_output.txt* has been written to disk, M-LOOP will read it and delete it. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
.. _sec-options: | ||
|
||
Options | ||
------- | ||
I like turtles 3 |
Oops, something went wrong.