Skip to content

Commit

Permalink
Remove optuna default values (#235)
Browse files Browse the repository at this point in the history
* Remove some of the optuna default values
* Add more explanatory comments in mnist_optuna.yaml
  • Loading branch information
nils-werner authored Feb 19, 2022
1 parent d25db15 commit fb7c206
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions configs/hparams_search/mnist_optuna.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# @package _global_

# example hyperparameter optimization of some experiment with Optuna:
# python train.py -m hparams_search=mnist_optuna experiment=example_simple hydra.sweeper.n_trials=30
# python train.py -m hparams_search=mnist_optuna experiment=example

defaults:
- override /hydra/sweeper: optuna
Expand All @@ -10,35 +10,35 @@ defaults:
# make sure this is the correct name of some metric logged in lightning module!
optimized_metric: "val/acc_best"

# here we define Optuna hyperparameter search
# it optimizes for value returned from function with @hydra.main decorator
# docs: https://hydra.cc/docs/next/plugins/optuna_sweeper
hydra:
# here we define Optuna hyperparameter search
# it optimizes for value returned from function with @hydra.main decorator
# learn more here: https://hydra.cc/docs/next/plugins/optuna_sweeper
sweeper:
_target_: hydra_plugins.hydra_optuna_sweeper.optuna_sweeper.OptunaSweeper

# storage URL to persist optimization results
# for example, you can use SQLite if you set 'sqlite:///example.db'
storage: null

# name of the study to persist optimization results
study_name: null

# number of parallel workers
n_jobs: 1

# 'minimize' or 'maximize' the objective
direction: maximize

# number of experiments that will be executed
n_trials: 20
# total number of runs that will be executed
n_trials: 25

# choose Optuna hyperparameter sampler
# learn more here: https://optuna.readthedocs.io/en/stable/reference/samplers.html
# docs: https://optuna.readthedocs.io/en/stable/reference/samplers.html
sampler:
_target_: optuna.samplers.TPESampler
seed: 12345
consider_prior: true
prior_weight: 1.0
consider_magic_clip: true
consider_endpoints: false
n_startup_trials: 10
n_ei_candidates: 24
multivariate: false
warn_independent_sampling: true
n_startup_trials: 10 # number of random sampling runs before optimization starts

# define range of hyperparameters
search_space:
Expand Down

0 comments on commit fb7c206

Please sign in to comment.