Deep Reinforcement Learning bằng Python
Timothée Carayol
Principal Machine Learning Engineer, Komment
| Ví dụ |
|---|
| Tỷ lệ chiết khấu |
| PPO: clipping epsilon, entropy bonus |
| Experience replay: kích thước buffer, batch size |
| Lịch epsilon giảm dần (greedy) |
| Fixed Q-targets: $\tau$ |
| Learning rate |
| Số lớp, số nút mỗi lớp... |
Mục tiêu: phần thưởng tích lũy trung bình
Kỹ thuật tìm kiếm siêu tham số:


Quy trình Optuna:
study của 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}
Trong hàm objective:
Linh hoạt hoàn toàn trong khai báo siêu tham số:
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 với sampler mặc định (TPE)n_trials: chạy đến khi dừng
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 bằng Python