|
2 | 2 | Tutorial: Basic Grid Search
|
3 | 3 | ***************************
|
4 | 4 |
|
5 |
| -In this tutorial, we learn how to set up cluster_utils to run a basic grid search on an |
6 |
| -arbitrary optimization function. It does not cover all available options but instead |
7 |
| -shows the minimal steps needed to get started. |
| 5 | +In this tutorial you will learn |
| 6 | + |
| 7 | +- how to write a simple script that can be executed by cluster-utils, and |
| 8 | +- how to configure cluster-utils to run a grid search over a few parameters on your |
| 9 | + script. |
| 10 | + |
| 11 | +It does not cover all available options but instead shows the minimal steps needed to |
| 12 | +get started. |
8 | 13 |
|
9 | 14 | --------
|
10 | 15 |
|
| 16 | + |
| 17 | +What is grid search? |
| 18 | +==================== |
| 19 | + |
| 20 | +For grid search, you specify a list of parameters and, for each of them, a list of |
| 21 | +values to check. cluster-utils will then execute your script with all possible |
| 22 | +combinations of parameter values and collect the resulting metrics (e.g. the reward |
| 23 | +achieved by a policy trained with the given parameters). |
| 24 | +In the end, you will get an overview of the results and a list of parameter values that |
| 25 | +performed best with respect to your metric. |
| 26 | + |
| 27 | +In the example below, we use the Rosenbrock function:: |
| 28 | + |
| 29 | + f(x,y) = (1 - x)² + 100 · (y - x²)² |
| 30 | + |
| 31 | +For each of the two parameters ``x`` and ``y``, we will check the values ``[0.0, 0.5, |
| 32 | +1.0, 1.5, 2.0]``. That is, a total of 25 jobs will be run with the following parameter |
| 33 | +values: |
| 34 | + |
| 35 | +.. csv-table:: |
| 36 | + :header-rows: 1 |
| 37 | + |
| 38 | + x,y |
| 39 | + 0.0,0.0 |
| 40 | + 0.0,0.5 |
| 41 | + 0.0,1.0 |
| 42 | + 0.0,1.5 |
| 43 | + 0.0,2.0 |
| 44 | + 0.5,0.0 |
| 45 | + 0.5,0.5 |
| 46 | + ...,... |
| 47 | + |
| 48 | + |
11 | 49 | Prepare your code
|
12 | 50 | =================
|
13 | 51 |
|
|
0 commit comments