pub struct MultiModalModel {
pub config: MultiModalConfig,
/* private fields */
}Expand description
Complete multi-modal model combining encoders, fusion, and output projection
Fields§
§config: MultiModalConfigModel configuration
Implementations§
Source§impl MultiModalModel
impl MultiModalModel
Sourcepub fn new(config: MultiModalConfig) -> ModelResult<Self>
pub fn new(config: MultiModalConfig) -> ModelResult<Self>
Create a new multi-modal model from configuration.
Sourcepub fn forward_multimodal(
&mut self,
inputs: &[Array1<f32>],
) -> ModelResult<Array1<f32>>
pub fn forward_multimodal( &mut self, inputs: &[Array1<f32>], ) -> ModelResult<Array1<f32>>
Forward pass with all modality inputs present.
inputs must contain one Array1<f32> per modality, in the same order
as config.modalities.
Sourcepub fn forward_with_missing(
&mut self,
inputs: &[Option<Array1<f32>>],
) -> ModelResult<Array1<f32>>
pub fn forward_with_missing( &mut self, inputs: &[Option<Array1<f32>>], ) -> ModelResult<Array1<f32>>
Forward pass with optional modalities.
Missing modalities (None) are replaced with zero vectors.
Sourcepub fn num_modalities(&self) -> usize
pub fn num_modalities(&self) -> usize
Number of modalities.
Sourcepub fn modality_names(&self) -> Vec<&Modality>
pub fn modality_names(&self) -> Vec<&Modality>
References to each modality identifier.
Sourcepub fn total_params(&self) -> usize
pub fn total_params(&self) -> usize
Total trainable parameter count.
Trait Implementations§
Source§impl AutoregressiveModel for MultiModalModel
impl AutoregressiveModel for MultiModalModel
Get the model’s hidden dimension
Source§fn num_layers(&self) -> usize
fn num_layers(&self) -> usize
Get number of layers
Source§fn model_type(&self) -> ModelType
fn model_type(&self) -> ModelType
Get model type identifier
Source§fn get_states(&self) -> Vec<HiddenState>
fn get_states(&self) -> Vec<HiddenState>
Get current hidden states for all layers
Source§fn set_states(&mut self, states: Vec<HiddenState>) -> ModelResult<()>
fn set_states(&mut self, states: Vec<HiddenState>) -> ModelResult<()>
Set hidden states for all layers
Source§fn load_weights_json(&mut self, _path: &Path) -> ModelResult<()>
fn load_weights_json(&mut self, _path: &Path) -> ModelResult<()>
Load weights from a JSON file (
HashMap<String, Vec<f32>> format). Read moreSource§fn save_weights_json(&self, _path: &Path) -> ModelResult<()>
fn save_weights_json(&self, _path: &Path) -> ModelResult<()>
Save weights to a JSON file (
HashMap<String, Vec<f32>> format). Read moreSource§impl SignalPredictor for MultiModalModel
impl SignalPredictor for MultiModalModel
Source§fn step(&mut self, input: &Array1<f32>) -> CoreResult<Array1<f32>>
fn step(&mut self, input: &Array1<f32>) -> CoreResult<Array1<f32>>
Step with a single concatenated input.
The input is split into per-modality chunks based on each encoder’s
input_dim, concatenated in the order of config.modalities.
Source§fn context_window(&self) -> usize
fn context_window(&self) -> usize
Get the current context window size
Auto Trait Implementations§
impl Freeze for MultiModalModel
impl RefUnwindSafe for MultiModalModel
impl Send for MultiModalModel
impl Sync for MultiModalModel
impl Unpin for MultiModalModel
impl UnsafeUnpin for MultiModalModel
impl UnwindSafe for MultiModalModel
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> 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