pub struct LearningService { /* private fields */ }Expand description
Main learning service for GNN-based embedding refinement.
This service manages:
- GNN model training on transition graphs
- Embedding refinement through message passing
- Edge prediction for relationship modeling
- Continual learning with EWC regularization
Implementations§
Source§impl LearningService
impl LearningService
Sourcepub fn new(config: LearningConfig) -> Self
pub fn new(config: LearningConfig) -> Self
Create a new learning service with the given configuration
Sourcepub fn with_repository(self, repository: Arc<dyn LearningRepository>) -> Self
pub fn with_repository(self, repository: Arc<dyn LearningRepository>) -> Self
Create a learning service with a repository
Sourcepub fn config(&self) -> &LearningConfig
pub fn config(&self) -> &LearningConfig
Get the current configuration
Sourcepub fn model_type(&self) -> GnnModelType
pub fn model_type(&self) -> GnnModelType
Get the model type
Sourcepub async fn start_session(&self) -> LearningResult<String>
pub async fn start_session(&self) -> LearningResult<String>
Start a new training session
Sourcepub async fn train_epoch(
&self,
graph: &TransitionGraph,
) -> LearningResult<TrainingMetrics>
pub async fn train_epoch( &self, graph: &TransitionGraph, ) -> LearningResult<TrainingMetrics>
Sourcepub async fn refine_embeddings(
&self,
embeddings: &[(EmbeddingId, Vec<f32>)],
) -> LearningResult<Vec<RefinedEmbedding>>
pub async fn refine_embeddings( &self, embeddings: &[(EmbeddingId, Vec<f32>)], ) -> LearningResult<Vec<RefinedEmbedding>>
Sourcepub async fn predict_edge(
&self,
from: &[f32],
to: &[f32],
) -> LearningResult<f32>
pub async fn predict_edge( &self, from: &[f32], to: &[f32], ) -> LearningResult<f32>
Sourcepub async fn complete_session(&self) -> LearningResult<()>
pub async fn complete_session(&self) -> LearningResult<()>
Complete the current training session
Sourcepub async fn fail_session(&self, error: impl Into<String>) -> LearningResult<()>
pub async fn fail_session(&self, error: impl Into<String>) -> LearningResult<()>
Fail the current session with an error
Sourcepub async fn get_session(&self) -> Option<LearningSession>
pub async fn get_session(&self) -> Option<LearningSession>
Get the current session status
Sourcepub async fn consolidate_ewc(
&self,
graph: &TransitionGraph,
) -> LearningResult<()>
pub async fn consolidate_ewc( &self, graph: &TransitionGraph, ) -> LearningResult<()>
Save EWC state from current model for future regularization
Auto Trait Implementations§
impl Freeze for LearningService
impl !RefUnwindSafe for LearningService
impl Send for LearningService
impl Sync for LearningService
impl Unpin for LearningService
impl !UnwindSafe for LearningService
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