Last active
February 27, 2022 09:47
-
-
Save hppRC/f67e8fc0f4905a7c6f03e092535dee59 to your computer and use it in GitHub Desktop.
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
N_TRIALS=10 | |
STORAGE=sqlite:///example.db | |
STUDY_NAME=`optuna create-study --storage $STORAGE` | |
DISTRIBUTIONS=`cat distributions.json` | |
for _ in `seq 1 $N_TRIALS`; do | |
trial=`optuna ask \ | |
--storage $STORAGE \ | |
--study-name $STUDY_NAME \ | |
--search-space "$DISTRIBUTIONS" \ | |
--direction minimize` | |
x=`echo $trial | jq .params.x` | |
y=`echo "($x - 2) ^ 2" | bc` | |
number=`echo $trial | jq .number` | |
optuna tell \ | |
--storage $STORAGE \ | |
--study-name $STUDY_NAME \ | |
--trial-number $number \ | |
--value $y | |
done | |
optuna trials --study-name $STUDY_NAME --storage $STORAGE | |
optuna best-trials --study-name $STUDY_NAME --storage $STORAGE | |
optuna best-trial --study-name $STUDY_NAME --storage $STORAGE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
distributions.json