87 Tensor last_action_indices_;
88 bool has_forwarded_ =
false;
loss = mean_b( (q_values[b, a_b] - targets[b,0])^2 ), where a_b is the action actually taken on trans...
Definition dqn_loss.hpp:37
Tensor backward() const
Gradient w.r.t. q_values: 2*(q_values[b,a_b] - targets[b,0])/N in the taken action's column,...
float forward(const Tensor &q_values, const Tensor &actions, const Tensor &targets)
Computes the masked MSE and caches everything backward() needs.
DQNLoss(DeviceBackend *backend)
Constructs a DQN loss.
Vendor-agnostic compute/memory backend. CPUBackend, CUDABackend (Phase 1.5), and HIPBackend (Phase 1....
Definition device_backend.hpp:219
N-dimensional tensor. Owns its data buffer exclusively; a DeviceBackend* is injected (not owned) – th...
Definition tensor.hpp:29
Abstract interface isolating vendor-specific memory/compute operations from Tensor/ComputationGraph.
Definition acquisition_functions.hpp:16
N-dimensional tensor – owns a buffer via DeviceBackend*, RAII (Rule of Five).