Skip to content

Commit

Permalink
cleanup of Hydra workdir configuration page
Browse files Browse the repository at this point in the history
  • Loading branch information
omry committed May 5, 2020
1 parent 1e0d044 commit 5763eef
Showing 1 changed file with 6 additions and 34 deletions.
40 changes: 6 additions & 34 deletions website/docs/configure_hydra/workdir.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ id: workdir
title: Customizing working directory pattern
sidebar_label: Customizing working directory pattern
---
Below are a few examples of customizing output directory patterns.

Run output directory grouped by day:
```yaml
Expand Down Expand Up @@ -33,42 +34,13 @@ hydra:

```

Run output directory can contain override parameters for the job
```yaml
hydra:
run:
dir: output/${hydra.job.override_dirname}
```
Run output directory can contain override parameters for the job:

### Configuring hydra.job.override_dirname
`hydra.job.override_dirname` can be configured via hydra.job.config.override_dirname.
You can exclude keys such as `random_seed` or change the separator used to construct override_dirname.
See [Override dirname](./job#hydrajoboverride_dirname) in the Job configuration page for details on how to customize
`hydra.job.override_dirname`.

```yaml
hydra:
job:
config:
# configuration for the ${hydra.job.override_dirname} runtime variable
override_dirname:
kv_sep: '='
item_sep: ','
exclude_keys: []
```

### Customizing outputs with substitution through the CLI

Outputs can also be configured through the CLI, like any other configuration.

>python train.py model.nb_layers=3 hydra.run.dir=3_layers

This feature can become really powerful to write multiruns without boilerplate using interpolation.

```
python train.py --multirun \
model.nb_layers=1,2,3,5 \
hydra.sweep.dir=multiruns/layers_effect \
hydra.sweep.subdir=\${model.nb_layers}
run:
dir: output/${hydra.job.override_dirname}
```
With bash, be careful to escape the $ symbol. Otherwise, bash will try to resolve the interpolation, instead of passing it to Hydra.

0 comments on commit 5763eef

Please sign in to comment.