forked from ashleve/lightning-hydra-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add conference badges * change TestDataset to ImgDataset * update conda env * bump package versions * update README * move optuna config to subfolder
- Loading branch information
Łukasz Zalewski
authored
Apr 15, 2021
1 parent
296c5bf
commit e27c11c
Showing
8 changed files
with
95 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# @package _global_ | ||
|
||
# example hyperparameter optimization of some experiment with Optuna: | ||
# python run.py -m hparams_search=mnist_optuna experiment=exp_example_simple | ||
# python run.py -m hparams_search=mnist_optuna experiment=exp_example_simple hydra.sweeper.n_trials=30 | ||
# python run.py -m hparams_search=mnist_optuna experiment=exp_example_simple logger=wandb | ||
|
||
defaults: | ||
- override /hydra/sweeper: optuna | ||
|
||
|
||
# choose metric which will be optimized by Optuna | ||
optimized_metric: "val/acc_best" | ||
|
||
|
||
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: null | ||
study_name: null | ||
n_jobs: 1 | ||
|
||
# 'minimize' or 'maximize' the objective | ||
direction: maximize | ||
|
||
# number of experiments that will be executed | ||
n_trials: 20 | ||
|
||
# choose Optuna hyperparameter sampler | ||
# learn more here: 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 | ||
|
||
# define range of hyperparameters | ||
search_space: | ||
datamodule.batch_size: | ||
type: categorical | ||
choices: [32, 64, 128] | ||
model.lr: | ||
type: float | ||
low: 0.0001 | ||
high: 0.2 | ||
model.lin1_size: | ||
type: categorical | ||
choices: [32, 64, 128, 256, 512] | ||
model.lin2_size: | ||
type: categorical | ||
choices: [32, 64, 128, 256, 512] | ||
model.lin3_size: | ||
type: categorical | ||
choices: [32, 64, 128, 256, 512] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters