-
Hi, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This seems to be working if anyone is interested: def sample_params(trial:optuna.Trial,): Also it looks like the break step is not all that relevant if you are using callbacks (LoggingCallback in the tutorial) when optimizing your optuna. |
Beta Was this translation helpful? Give feedback.
This seems to be working if anyone is interested:
def sample_params(trial:optuna.Trial,):
break_step = trial.suggest_categorical("break_step", [1e4, 1e5])
gamma = trial.suggest_categorical("gamma", [0.8, 0.9, 0.95, 0.98, 0.99])
learning_rate = trial.suggest_loguniform("learning_rate", 1e-6, 1e-3)
ERL_PARAMS = {
"break_step":break_step,
"gamma": gamma,
"learning_rate": learning_rate,
}
return ERL_PARAMS
def objective(trial:optuna.Trial):
hyperparameters = sample_params(trial)
ERL_PPO_PARAMS = dict(itertools.islice(hyperparameters.items(), 2, 3))
break_step = hyperparameters['break_step']
train(
drl_lib='elegantrl',
env=env,
model_name='ppo',
erl_params= ERL_PPO_PARAMS,
cwd='./papertrading_…