pub struct MobileOptimizationEngine { /* private fields */ }Expand description
Comprehensive mobile optimization engine
Implementations§
Source§impl MobileOptimizationEngine
impl MobileOptimizationEngine
Sourcepub fn new(config: MobileConfig) -> Result<Self>
pub fn new(config: MobileConfig) -> Result<Self>
Create new optimization engine with mobile configuration
Sourcepub fn optimize_model_weights(
&mut self,
weights: &HashMap<String, Tensor>,
) -> Result<HashMap<String, Tensor>>
pub fn optimize_model_weights( &mut self, weights: &HashMap<String, Tensor>, ) -> Result<HashMap<String, Tensor>>
Optimize model weights for mobile deployment
Sourcepub fn estimate_memory_footprint(&self, total_params: usize) -> MemoryFootprint
pub fn estimate_memory_footprint(&self, total_params: usize) -> MemoryFootprint
Estimate memory footprint for given number of parameters
Sourcepub fn optimize_tensor(&self, tensor: &Tensor) -> Result<Tensor>
pub fn optimize_tensor(&self, tensor: &Tensor) -> Result<Tensor>
Optimize tensor for mobile inference
Sourcepub fn optimize_batch(&self, tensors: &[Tensor]) -> Result<Vec<Tensor>>
pub fn optimize_batch(&self, tensors: &[Tensor]) -> Result<Vec<Tensor>>
Optimize batch of tensors for mobile inference
Sourcepub fn optimize_model(
&mut self,
model: &mut MobileModel,
) -> Result<OptimizationReport>
pub fn optimize_model( &mut self, model: &mut MobileModel, ) -> Result<OptimizationReport>
Optimize model for mobile deployment
Sourcepub fn enable_knowledge_distillation(
&mut self,
distillation_config: DistillationConfig,
) -> Result<()>
pub fn enable_knowledge_distillation( &mut self, distillation_config: DistillationConfig, ) -> Result<()>
Enable knowledge distillation with configuration
Sourcepub fn distill_model(
&mut self,
teacher_model: TeacherModel,
student_model: StudentModel,
training_data: &[DistillationSample],
) -> Result<StudentModel>
pub fn distill_model( &mut self, teacher_model: TeacherModel, student_model: StudentModel, training_data: &[DistillationSample], ) -> Result<StudentModel>
Perform knowledge distillation to create a compressed student model
Sourcepub fn get_distillation_stats(&self) -> Option<&DistillationStats>
pub fn get_distillation_stats(&self) -> Option<&DistillationStats>
Get knowledge distillation statistics
Sourcepub fn enable_adaptive_inference(
&mut self,
adaptive_config: AdaptiveConfig,
) -> Result<()>
pub fn enable_adaptive_inference( &mut self, adaptive_config: AdaptiveConfig, ) -> Result<()>
Enable adaptive inference with configuration
Sourcepub fn adaptive_infer(
&mut self,
input: &Tensor,
context: InferenceContext,
) -> Result<InferenceResult>
pub fn adaptive_infer( &mut self, input: &Tensor, context: InferenceContext, ) -> Result<InferenceResult>
Perform adaptive inference based on device capabilities and context
Sourcepub fn get_adaptive_stats(&self) -> Option<&AdaptiveStats>
pub fn get_adaptive_stats(&self) -> Option<&AdaptiveStats>
Get adaptive inference statistics
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for MobileOptimizationEngine
impl !UnwindSafe for MobileOptimizationEngine
impl Freeze for MobileOptimizationEngine
impl Send for MobileOptimizationEngine
impl Sync for MobileOptimizationEngine
impl Unpin for MobileOptimizationEngine
impl UnsafeUnpin for MobileOptimizationEngine
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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