pub struct JointStats {
pub policy_loss: Vec<f64>,
pub value_loss: Vec<f64>,
pub entropy: Vec<f64>,
pub clip_fraction: Vec<f64>,
pub approx_kl: Vec<f64>,
pub explained_var: Vec<f64>,
pub aux_loss: f64,
pub total_loss: f64,
pub num_mb_steps: usize,
}Expand description
Per-update training statistics for the joint trainer.
Mirrors crate::train::ppo::TrainingStats but with per-agent
vectors for the agent-local quantities and a single shared scalar
for the auxiliary cross-agent term.
Fields§
§policy_loss: Vec<f64>Per-agent policy loss (averaged across PPO epochs).
value_loss: Vec<f64>Per-agent value-function loss.
entropy: Vec<f64>Per-agent entropy.
clip_fraction: Vec<f64>Per-agent fraction of clipped updates.
approx_kl: Vec<f64>Per-agent approximate KL divergence between old and new policy.
explained_var: Vec<f64>Per-agent explained variance of the value function.
aux_loss: f64Auxiliary cross-agent loss (e.g. λ * redundancy_penalty). Scalar shared by all agents because it’s computed jointly on the same minibatch features.
total_loss: f64Total summed loss Σ_i agent_loss_i + aux_loss (averaged across
PPO epochs).
num_mb_steps: usizeNumber of minibatch gradient steps actually taken across the whole
update (Σ_epochs minibatches walked). For the default
single-minibatch path this equals n_epochs; with
JointTrainerConfig::iterate_all_minibatches it equals
n_epochs × ceil(num_steps / minibatch_size), and with
JointTrainerConfig::max_minibatches_per_epoch = Some(cap) it is
reduced to n_epochs × min(cap, num_minibatches). Exposed so the
throughput lever (issue #251) is observable/testable.
Implementations§
Source§impl JointStats
impl JointStats
Sourcepub fn zeros(num_agents: usize) -> Self
pub fn zeros(num_agents: usize) -> Self
Construct a fully-zeroed JointStats sized for num_agents
agents.
Trait Implementations§
Source§impl Clone for JointStats
impl Clone for JointStats
Source§fn clone(&self) -> JointStats
fn clone(&self) -> JointStats
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for JointStats
impl Debug for JointStats
Source§impl Default for JointStats
impl Default for JointStats
Source§fn default() -> JointStats
fn default() -> JointStats
Auto Trait Implementations§
impl Freeze for JointStats
impl RefUnwindSafe for JointStats
impl Send for JointStats
impl Sync for JointStats
impl Unpin for JointStats
impl UnsafeUnpin for JointStats
impl UnwindSafe for JointStats
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more