Trajectories
Design
┌────────────────────────────┐
│(state=..., action=..., ...)│
└──────────────┬─────────────┘
push! │ append!
┌───────────────────▼───────────────────┐
│ Trajectory │
│ ┌─────────────────────────────────┐ │
│ │ Traces │ │
│ │ ┌───────────────────┐ │ │
│ │ state: │CircularArrayBuffer│ │ │
│ │ └───────────────────┘ │ │
│ │ ┌───────────────────┐ │ │
│ │ action:│CircularArrayBuffer│ │ │
│ │ └───────────────────┘ │ │
│ │ ...... │ │
│ └─────────────────────────────────┘ │
| Sampler |
└───────────────────┬───────────────────┘
│ batch sampling
┌──────────────▼─────────────┐
│(state=..., action=..., ...)│
└────────────────────────────┘
┌──────────────┐ ┌──────────────┐
│Single Element│ │Batch Elements│
└──────┬───────┘ └──────┬───────┘
│ │
push! └──────┐ ┌───────┘ append!
│ │
┌─────────────┼────┼─────────────────────────────┐
│ ┌──▼────▼──┐ AsyncTrajectory │
│ │Channel In│ │
│ └─────┬────┘ │
│ take! │ │
│ ┌─────▼─────┐ push! ┌────────────┐ │
│ │RateLimiter├──────────► Trajectory │ │
│ └─────┬─────┘ append! └────*───────┘ │
│ │ * │
│ put! │********************** │
│ │ batch sampling │
│ ┌─────▼─────┐ │
│ │Channel Out│ │
│ └───────────┘ │
└────────────────────────────────────────────────┘
Acknowledgement
This async version is mainly inspired by deepmind/reverb.