Skip to content

Commit 98dd32e

Browse files
authored
Merge pull request #192 from resibots/fix_tut
Minor tutorial fixes
2 parents 228901c + 3141761 commit 98dd32e

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

docs/tutorials/basic_example.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ To begin, the ``main`` file has to include the necessary files, and declare the
4141
.. literalinclude:: ../../src/tutorials/basic_example.cpp
4242
:language: c++
4343
:linenos:
44-
:lines: 47-93
44+
:lines: 55-94
4545

4646

4747

@@ -52,7 +52,7 @@ Then, we have to define the evaluation function for the optimizer to call:
5252
.. literalinclude:: ../../src/tutorials/basic_example.cpp
5353
:language: c++
5454
:linenos:
55-
:lines: 95-108
55+
:lines: 95-109
5656

5757
It is required that the evaluation struct has the static members ``dim_in`` and ``dim_out``, specifying the input and output dimensions.
5858
Also, it should have the ``operator()`` expecting a ``const Eigen::VectorXd&`` of size ``dim_in``, and return another one, of size ``dim_out``.
@@ -62,7 +62,7 @@ With this, we can declare the main function:
6262
.. literalinclude:: ../../src/tutorials/basic_example.cpp
6363
:language: c++
6464
:linenos:
65-
:lines: 109-119
65+
:lines: 111-120
6666

6767

6868
Finally, from the root of limbo, run a build command, with the additional switch ``--exp myExp``: ::
@@ -76,4 +76,4 @@ Full ``main.cpp``:
7676
.. literalinclude:: ../../src/tutorials/basic_example.cpp
7777
:language: c++
7878
:linenos:
79-
:lines: 46-
79+
:lines: 48-

docs/tutorials/gp.rst

+8-8
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ We assume that our samples are in a vector called ``samples`` and that our obser
1313
.. literalinclude:: ../../src/tutorials/gp.cpp
1414
:language: c++
1515
:linenos:
16-
:lines: 75-84
16+
:lines: 75-85
1717

1818
Basic usage
1919
------------
@@ -23,14 +23,14 @@ We first create a basic GP with an Exponential kernel (``kernel::Exp<Params>``)
2323
.. literalinclude:: ../../src/tutorials/gp.cpp
2424
:language: c++
2525
:linenos:
26-
:lines: 58-62
26+
:lines: 60-63
2727

2828
The type of the GP is defined by the following lines:
2929

3030
.. literalinclude:: ../../src/tutorials/gp.cpp
3131
:language: c++
3232
:linenos:
33-
:lines: 87-89
33+
:lines: 87-90
3434

3535
To use the GP, we need :
3636

@@ -40,7 +40,7 @@ To use the GP, we need :
4040
.. literalinclude:: ../../src/tutorials/gp.cpp
4141
:language: c++
4242
:linenos:
43-
:lines: 91-98
43+
:lines: 92-99
4444

4545
Here we assume that the noise is the same for all samples and that it is equal to 0.01.
4646

@@ -57,7 +57,7 @@ To visualize the predictions of the GP, we can query it for many points and reco
5757
.. literalinclude:: ../../src/tutorials/gp.cpp
5858
:language: c++
5959
:linenos:
60-
:lines: 101-111
60+
:lines: 101-112
6161

6262

6363
Hyper-parameter optimization
@@ -71,21 +71,21 @@ A new GP type is defined as follows:
7171
.. literalinclude:: ../../src/tutorials/gp.cpp
7272
:language: c++
7373
:linenos:
74-
:lines: 115-117
74+
:lines: 116-118
7575

7676
It uses the default values for the parameters of ``SquaredExpARD``:
7777

7878
.. literalinclude:: ../../src/tutorials/gp.cpp
7979
:language: c++
8080
:linenos:
81-
:lines: 63-64
81+
:lines: 64-65
8282

8383
After calling the ``compute()`` method, the hyper-parameters can be optimized by calling the ``optimize_hyperparams()`` function. The GP does not need to be recomputed and we pass ``false`` for the last parameter in ``compute()`` as we do not need to compute the kernel matrix again (it will be recomputed in the hyper-parameters optimization).
8484

8585
.. literalinclude:: ../../src/tutorials/gp.cpp
8686
:language: c++
8787
:linenos:
88-
:lines: 121-122
88+
:lines: 122-123
8989

9090

9191
We can have a look at the difference between the two GPs:

docs/tutorials/opt.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,4 @@ Here is the full file.
7070
.. literalinclude:: ../../src/tutorials/opt.cpp
7171
:language: c++
7272
:linenos:
73-
:lines: 45-
73+
:lines: 46-

docs/tutorials/statistics.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -66,18 +66,18 @@ In order to configure the Bayesian optimizer to use our new statistics class, we
6666
.. literalinclude:: ../../src/tutorials/statistics.cpp
6767
:language: c++
6868
:linenos:
69-
:lines: 144-147
69+
:lines: 144-148
7070

7171
Then, we use it to define the optimizer:
7272

7373
.. literalinclude:: ../../src/tutorials/statistics.cpp
7474
:language: c++
7575
:linenos:
76-
:lines: 150
76+
:lines: 151
7777

7878
The full source code is available in `src/tutorials/statistics.cpp` and reproduced here:
7979

8080
.. literalinclude:: ../../src/tutorials/statistics.cpp
8181
:language: c++
8282
:linenos:
83-
:lines: 46-
83+
:lines: 48-

0 commit comments

Comments
 (0)