thrust_rl/train/dqn.rs
1//! DQN trainer (Burn backend).
2//!
3//! After phase 5 of the Burn migration (#82), Burn is the only tensor
4//! backend in the workspace. The historical `train::dqn_burn` parallel
5//! sibling has been collapsed back into `train::dqn`. See the parallel
6//! `crate::train::ppo` module for the same rationale.
7//!
8//! # Contents
9//!
10//! - [`config`] — `DQNConfig` hyperparameters / builder API.
11//! - [`loss`] — backend-generic DQN / Double-DQN loss math.
12//! - [`trainer`] — `DQNTrainerBurn<B, Q, O>` that owns the online Q-network
13//! module (Burn's optimizer-consumes-module ownership model) and exposes a
14//! `train_step` that runs Smooth-L1 loss / gradient-step logic.
15
16pub mod config;
17pub mod loss;
18pub mod trainer;
19
20pub use config::DQNConfig;
21pub use loss::{
22 compute_dqn_loss, compute_dqn_loss_double, compute_loss, compute_td_target,
23 compute_td_target_double, gather_action_q, huber_per_sample,
24};
25pub use trainer::{DQNStepStatsBurn, DQNTrainerBurn};