pub struct InferenceModel {Show 13 fields
pub obs_dim: usize,
pub action_dim: usize,
pub hidden_dim: usize,
pub activation: InferenceActivation,
pub metadata: Option<TrainingMetadata>,
pub shared_fc1_weight: Vec<Vec<f32>>,
pub shared_fc1_bias: Vec<f32>,
pub shared_fc2_weight: Vec<Vec<f32>>,
pub shared_fc2_bias: Vec<f32>,
pub policy_weight: Vec<Vec<f32>>,
pub policy_bias: Vec<f32>,
pub value_weight: Vec<Vec<f32>>,
pub value_bias: Vec<f32>,
}Expand description
A serializable MLP model for inference
This struct contains all the weights and biases needed to run inference in pure Rust (no Burn/tensor-stack dependency).
Fields§
§obs_dim: usizeInput dimension
action_dim: usizeOutput dimension (number of actions)
Hidden layer dimension
activation: InferenceActivationActivation function
metadata: Option<TrainingMetadata>Training metadata (optional)
Shared layer 1: weights [obs_dim, hidden_dim]
Shared layer 1: bias [hidden_dim]
Shared layer 2: weights [hidden_dim, hidden_dim]
Shared layer 2: bias [hidden_dim]
policy_weight: Vec<Vec<f32>>Policy head: weights [hidden_dim, action_dim]
policy_bias: Vec<f32>Policy head: bias [action_dim]
value_weight: Vec<Vec<f32>>Value head: weights [hidden_dim, 1]
value_bias: Vec<f32>Value head: bias [1]
Implementations§
Trait Implementations§
Source§impl Clone for InferenceModel
impl Clone for InferenceModel
Source§fn clone(&self) -> InferenceModel
fn clone(&self) -> InferenceModel
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InferenceModel
impl Debug for InferenceModel
Source§impl<'de> Deserialize<'de> for InferenceModel
impl<'de> Deserialize<'de> for InferenceModel
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for InferenceModel
impl RefUnwindSafe for InferenceModel
impl Send for InferenceModel
impl Sync for InferenceModel
impl Unpin for InferenceModel
impl UnsafeUnpin for InferenceModel
impl UnwindSafe for InferenceModel
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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>
Converts
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>
Converts
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