1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//! Policy and neural network wrappers.
//!
//! After phase 5 of the Burn migration (#82), all policy networks live on
//! the Burn backend. The pure-Rust WASM inference path (`inference` and
//! `universal_inference` modules) is independent of Burn and is
//! available without the `training` feature.
/// MLP actor-critic policy used by the CartPole / Pong / SimpleBandit
/// PPO trainers.
/// Multi-discrete MLP policy used by Bucket Brigade and similar
/// multi-discrete action spaces.
/// LSTM (recurrent) actor-critic policy — Phase 1 of the recurrent-policy
/// epic (#262). Carries memory across timesteps via a Burn 0.21 `Lstm`
/// trunk, with `forward_step` for rollout collection and
/// `evaluate_sequences` for the rank-3 training forward.
/// Seeded, host-side weight-initialization helpers that make policy
/// construction bit-exact under `PsroConfig::seed` / `NfspConfig::seed`
/// (issue #135). Burn 0.21's `Initializer` has no seed parameter, so we
/// pre-compute the trunk + head weights from an `StdRng` instead.
/// SAC stochastic Gaussian actor (tanh-squashed) for continuous control.
/// DQN Q-network with the same MLP backbone as `MlpPolicy` but with a
/// single Q-head.
/// Continuous-action `Q(s, a)` critic for SAC (twin critics + targets),
/// with hard and Polyak (soft) target-sync helpers.
/// 3-conv + 2-fc CNN used by the Snake trainer.
/// Nature-DQN-scale CNN policies (actor-critic + Q-network) for the Atari
/// (ALE) workload.