pub struct GraphWeightOptimizer { /* private fields */ }Expand description
Graph weight optimizer using simplified DW-GRPO approach
Implementations§
Source§impl GraphWeightOptimizer
impl GraphWeightOptimizer
Sourcepub fn with_config(config: OptimizerConfig) -> Self
pub fn with_config(config: OptimizerConfig) -> Self
Create optimizer with custom configuration
Sourcepub fn with_ollama_client(self, client: OllamaClient) -> Self
pub fn with_ollama_client(self, client: OllamaClient) -> Self
Set Ollama client for LLM-based evaluation
Sourcepub async fn optimize_weights(
&mut self,
graph: &mut KnowledgeGraph,
test_queries: &[TestQuery],
) -> Result<()>
pub async fn optimize_weights( &mut self, graph: &mut KnowledgeGraph, test_queries: &[TestQuery], ) -> Result<()>
Sourcepub fn history(&self) -> &[OptimizationStep]
pub fn history(&self) -> &[OptimizationStep]
Get optimization history
Sourcepub fn final_metrics(&self) -> Option<(f32, f32, f32, f32)>
pub fn final_metrics(&self) -> Option<(f32, f32, f32, f32)>
Get final metrics after optimization
Sourcepub fn total_improvement(&self) -> f32
pub fn total_improvement(&self) -> f32
Get improvement from first to last iteration
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GraphWeightOptimizer
impl !RefUnwindSafe for GraphWeightOptimizer
impl Send for GraphWeightOptimizer
impl Sync for GraphWeightOptimizer
impl Unpin for GraphWeightOptimizer
impl UnsafeUnpin for GraphWeightOptimizer
impl !UnwindSafe for GraphWeightOptimizer
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