Skip to content

Commit

Permalink
reordering + renaming of declarative usage sections + doc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
danrgll committed May 23, 2024
1 parent 525fe5c commit 8584716
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 43 deletions.
3 changes: 1 addition & 2 deletions docs/doc_yamls/full_configuration_template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ pipeline_space:
log: True
optimizer:
choices: [adam, sgd, adamw]
epochs:
value: 50
epochs: 50

root_directory: path/to/results # Directory for result storage
max_evaluations_total: 20 # Budget
Expand Down
3 changes: 1 addition & 2 deletions docs/doc_yamls/simple_example_including_run_pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ pipeline_space:
log: True
optimizer:
choices: [adam, sgd, adamw]
epochs:
value: 50
epochs: 50

root_directory: path/to/results # Directory for result storage
max_evaluations_total: 20 # Budget
67 changes: 31 additions & 36 deletions docs/reference/declarative_usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Below is a straightforward YAML configuration example for NePS covering the requ
```


#### Advanced Configuration with External Pipeline
#### Including `run_pipeline` in config.yaml for External Referencing
In addition to setting experimental parameters via YAML, this configuration example also specifies the pipeline function
and its location, enabling more flexible project structures.
=== "config.yaml"
Expand All @@ -35,7 +35,7 @@ and its location, enabling more flexible project structures.
neps.run(run_args="path/to/your/config.yaml")
```

#### Extended Configuration
#### Comprehensive YAML Configuration Template
This example showcases a more comprehensive YAML configuration, which includes not only the essential parameters
but also advanced settings for more complex setups.
=== "config.yaml"
Expand All @@ -58,7 +58,7 @@ through `neps.run`. For a detailed list of integrated optimizers, see [here](opt
omitted.

## Different Use Cases
### Customizing neps optimizer
### Customizing NePS optimizer
Customize an internal NePS optimizer by specifying its parameters directly in the `config.yaml`.
=== "config.yaml"
```yaml
Expand All @@ -74,25 +74,16 @@ Customize an internal NePS optimizer by specifying its parameters directly in th
For detailed information about the available optimizers and their parameters, please visit the [optimizer page](optimizers.md#list-available-searching-algorithms)



### Integrate Your Own Optimizer
You can also load your own custom optimizer and change its arguments in `config.yaml`.
### Testing Multiple Optimizer Configurations
Simplify experiments with multiple optimizer settings by outsourcing the optimizer configuration.
=== "config.yaml"
```yaml
--8<-- "docs/doc_yamls/loading_own_optimizer.yaml"
```

=== "run_neps.py"
```python
import neps
neps.run(run_args="path/to/your/config.yaml")
--8<-- "docs/doc_yamls/outsourcing_optimizer.yaml"
```

### Defining Hooks
Define hooks in your YAML configuration to extend the functionality of your experiment.
=== "config.yaml"
=== "searcher_setup.yaml"
```yaml
--8<-- "docs/doc_yamls/defining_hooks.yaml"
--8<-- "docs/doc_yamls/set_up_optimizer.yaml"
```

=== "run_neps.py"
Expand All @@ -101,7 +92,7 @@ Define hooks in your YAML configuration to extend the functionality of your expe
neps.run(run_args="path/to/your/config.yaml")
```

### Managing Large Search Spaces
### Handling Large Search Spaces
Manage large search spaces by outsourcing the pipeline space configuration in a separate YAML file or for keeping track
of your experiments.
=== "config.yaml"
Expand All @@ -120,16 +111,18 @@ of your experiments.
neps.run(run_args="path/to/your/config.yaml")
```

### Experimenting with Different Optimizer Settings
Simplify experiments with multiple optimizer settings by outsourcing the optimizer configuration.

### Using Architecture Search Spaces
Since the option for defining the search space via YAML is limited to HPO, grammar-based search spaces or architecture
search spaces must be loaded via a dictionary, which is then referenced in the `config.yaml`.
=== "config.yaml"
```yaml
--8<-- "docs/doc_yamls/outsourcing_optimizer.yaml"
--8<-- "docs/doc_yamls/loading_pipeline_space_dict.yaml"
```

=== "searcher_setup.yaml"
```yaml
--8<-- "docs/doc_yamls/set_up_optimizer.yaml"
=== "search_space.py"
```python
search_space = {}
```

=== "run_neps.py"
Expand All @@ -138,27 +131,29 @@ Simplify experiments with multiple optimizer settings by outsourcing the optimiz
neps.run(run_args="path/to/your/config.yaml")
```

### Using Architecture Search Spaces
Since the option for defining the search space via YAML is limited to HPO, grammar-based search spaces or architecture
search spaces must be loaded via a dictionary, which is then referenced in the `config.yaml`.

### Integrating Custom Optimizers
You can also load your own custom optimizer and change its arguments in `config.yaml`.
=== "config.yaml"
```yaml
--8<-- "docs/doc_yamls/loading_pipeline_space_dict.yaml"
--8<-- "docs/doc_yamls/loading_own_optimizer.yaml"
```

=== "search_space.py"
=== "run_neps.py"
```python
search_space = {}
import neps
neps.run(run_args="path/to/your/config.yaml")
```

### Adding Custom Hooks to Your Configuration
Define hooks in your YAML configuration to extend the functionality of your experiment.
=== "config.yaml"
```yaml
--8<-- "docs/doc_yamls/defining_hooks.yaml"
```

=== "run_neps.py"
```python
import neps
neps.run(run_args="path/to/your/config.yaml")
```

### Enable Multi-fidelity

### Utilizing Prior-Band Method


4 changes: 1 addition & 3 deletions docs/reference/pipeline_space.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,7 @@ Create a YAML file (e.g., `./pipeline_space.yaml`) with the parameter definition
type: categorical
choices: ["adam", "sgd", "rmsprop"]

dropout_rate:
type: constant
value: 0.5
dropout_rate: 0.5
```

=== "`run.py`"
Expand Down

0 comments on commit 8584716

Please sign in to comment.