pub struct DeepModel {
pub layers: Vec<DeepLayerSpec>,
pub alpha: f64,
pub gating: GatingSpec,
}Fields§
§layers: Vec<DeepLayerSpec>§alpha: f64Legacy Python catalogs omitted fusion tuning when the model only carried a layer graph. Zero preserves the historical neutral value.
gating: GatingSpecImplementations§
Source§impl DeepModel
impl DeepModel
pub fn to_layers(&self) -> MLResult<Vec<Layer>>
pub fn gating_runtime(&self) -> Gating
pub fn input_dimensions(&self) -> Option<usize>
Sourcepub fn validate(&self) -> MLResult<()>
pub fn validate(&self) -> MLResult<()>
Validate layer ordering, tensor shapes, dimensions, and numeric parameters.
Sourcepub fn predict(&self, ctx: &ExecutionContext) -> MLResult<PredictResult>
pub fn predict(&self, ctx: &ExecutionContext) -> MLResult<PredictResult>
Run CPU inference against an operator execution context.
Sourcepub fn predict_with_backend<B: MLBackend>(
&self,
backend: &B,
ctx: &ExecutionContext,
) -> MLResult<PredictResult>
pub fn predict_with_backend<B: MLBackend>( &self, backend: &B, ctx: &ExecutionContext, ) -> MLResult<PredictResult>
Run inference through a specific backend.
pub fn predict_features( &self, examples: &[(DocId, Vec<f64>)], ) -> MLResult<PredictResult>
pub fn predict_features_with_backend<B: MLBackend>( &self, backend: &B, examples: &[(DocId, Vec<f64>)], ) -> MLResult<PredictResult>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for DeepModel
impl<'de> Deserialize<'de> for DeepModel
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
impl StructuralPartialEq for DeepModel
Auto Trait Implementations§
impl Freeze for DeepModel
impl RefUnwindSafe for DeepModel
impl Send for DeepModel
impl Sync for DeepModel
impl Unpin for DeepModel
impl UnsafeUnpin for DeepModel
impl UnwindSafe for DeepModel
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