Deep Reinforcement Learning ด้วย Python
Timothée Carayol
Principal Machine Learning Engineer, Komment
| ตัวอย่าง |
|---|
| Discount rate |
| PPO: clipping epsilon, entropy bonus |
| Experience replay: buffer size, batch size |
| Decayed epsilon greediness schedule |
| Fixed Q-targets: $\tau$ |
| Learning rate |
| จำนวน layer, จำนวน node ต่อ layer... |
เป้าหมาย: ค่าเฉลี่ยของ cumulative rewards
เทคนิคการค้นหาไฮเปอร์พารามิเตอร์:


ขั้นตอนการใช้งาน Optuna:
study ของ Optuna
import optunadef objective(trial): ...study = optuna.create_study()study.optimize(objective, n_trials=100)
study.best_params
{'learning_rate': 0.001292481, 'batch_size': 8}
ใน objective function:
รองรับการระบุไฮเปอร์พารามิเตอร์ได้อย่างยืดหยุ่น:
def objective(trial: optuna.trial.Trial):# Hyperparameters x and y between -10 and 10x = trial.suggest_float('x', -10, 10) y = trial.suggest_float('y', -10, 10)# Return the metric to minimize return (x - 2) ** 2 + 1.2 * (y + 3) ** 2
n_trials ด้วย sampler เริ่มต้น (TPE)n_trials: รันต่อเนื่องจนกว่าจะหยุด
import sqlite study = optuna.create_study( storage="sqlite:///DRL.db", study_name="my_study")study.optimize(objective, n_trials=100)
loaded_study = optuna.load_study(
study_name="my_study",
storage="sqlite:///DRL.db")
optuna.visualization.plot_param_importances(study)

optuna.visualization.plot_contour(study)

Deep Reinforcement Learning ด้วย Python