oa::ml::policy::sample_tanh_normal

Sample a reparameterized tanh-normal policy. The returned raw action is mean + exp(clamped_log_stddev) * noise, so gradients flow through both distribution parameters while Philox noise stays detached. A nonzero seed is deterministic; seed zero follows OA’s process-local RNG convention. Errors Returns an error when mean/log-standard-deviation are not matching nonempty FP32 [E,A] matrices, value is not FP32 [E] on the same engine, bounds/epsilon are invalid, a size exceeds the shader ABI, or composite lowering fails.

FnRust public API

Function Documentation

pub fn sample_tanh_normal( mean: &Matrix, log_stddev: &Matrix, value: &Matrix, minimum: f32, maximum: f32, seed: u64, epsilon: f32 ) -> Result<ContinuousPolicyResult>
Sample a reparameterized tanh-normal policy. The returned raw action is mean + exp(clamped_log_stddev) * noise, so gradients flow through both distribution parameters while Philox noise stays detached. A nonzero seed is deterministic; seed zero follows OA’s process-local RNG convention. Errors Returns an error when mean/log-standard-deviation are not matching nonempty FP32 [E,A] matrices, value is not FP32 [E] on the same engine, bounds/epsilon are invalid, a size exceeds the shader ABI, or composite lowering fails.