pub struct TrainingPipeline { /* private fields */ }Expand description
Training pipeline for structured training workflows
Implementations§
Source§impl TrainingPipeline
impl TrainingPipeline
Sourcepub fn new(name: impl Into<String>, config: SonaConfig) -> Self
pub fn new(name: impl Into<String>, config: SonaConfig) -> Self
Create a new training pipeline
Sourcepub fn from_template(template: TrainingTemplate) -> Self
pub fn from_template(template: TrainingTemplate) -> Self
Create from template
Sourcepub fn with_batch_config(self, config: BatchConfig) -> Self
pub fn with_batch_config(self, config: BatchConfig) -> Self
Set batch configuration
Sourcepub fn with_training_method(self, method: TrainingMethod) -> Self
pub fn with_training_method(self, method: TrainingMethod) -> Self
Set training method
Sourcepub fn with_callback<C: TrainingCallback + 'static>(self, callback: C) -> Self
pub fn with_callback<C: TrainingCallback + 'static>(self, callback: C) -> Self
Set callback
Sourcepub fn with_pattern_extraction(self, enabled: bool) -> Self
pub fn with_pattern_extraction(self, enabled: bool) -> Self
Enable/disable pattern extraction
Sourcepub fn add_example(&mut self, example: TrainingExample)
pub fn add_example(&mut self, example: TrainingExample)
Add a training example
Sourcepub fn add_examples(
&mut self,
examples: impl IntoIterator<Item = TrainingExample>,
)
pub fn add_examples( &mut self, examples: impl IntoIterator<Item = TrainingExample>, )
Add multiple training examples
Sourcepub fn add_validation_example(&mut self, example: TrainingExample)
pub fn add_validation_example(&mut self, example: TrainingExample)
Add validation example
Sourcepub fn stage(&self) -> &PipelineStage
pub fn stage(&self) -> &PipelineStage
Get current stage
Sourcepub fn example_count(&self) -> usize
pub fn example_count(&self) -> usize
Get number of examples
Sourcepub fn metrics(&self) -> &TrainingMetrics
pub fn metrics(&self) -> &TrainingMetrics
Get metrics
Sourcepub fn engine(&self) -> &SonaEngine
pub fn engine(&self) -> &SonaEngine
Get engine reference
Sourcepub fn engine_mut(&mut self) -> &mut SonaEngine
pub fn engine_mut(&mut self) -> &mut SonaEngine
Get mutable engine reference
Sourcepub fn train(&mut self) -> Result<TrainingResult, String>
pub fn train(&mut self) -> Result<TrainingResult, String>
Run the training pipeline
Sourcepub fn clear_examples(&mut self)
pub fn clear_examples(&mut self)
Clear examples (keep engine state)
Auto Trait Implementations§
impl !Freeze for TrainingPipeline
impl !RefUnwindSafe for TrainingPipeline
impl Send for TrainingPipeline
impl Sync for TrainingPipeline
impl Unpin for TrainingPipeline
impl !UnwindSafe for TrainingPipeline
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