pub struct OptimizerBenchmarks { /* private fields */ }Expand description
Core optimizer benchmark suite
Provides fundamental benchmarking operations including step performance, convergence analysis, memory scaling, and sparse gradient handling.
Implementations§
Source§impl OptimizerBenchmarks
impl OptimizerBenchmarks
Sourcepub fn with_config(config: BenchmarkConfig) -> Self
pub fn with_config(config: BenchmarkConfig) -> Self
Create a new benchmark suite with custom configuration
Sourcepub fn config(&self) -> &BenchmarkConfig
pub fn config(&self) -> &BenchmarkConfig
Get the current configuration
Sourcepub fn set_config(&mut self, config: BenchmarkConfig)
pub fn set_config(&mut self, config: BenchmarkConfig)
Update the configuration
Sourcepub fn benchmark_step_performance<O: Optimizer>(
&self,
optimizer: O,
problem_size: usize,
) -> OptimizerResult<BenchmarkResult>
pub fn benchmark_step_performance<O: Optimizer>( &self, optimizer: O, problem_size: usize, ) -> OptimizerResult<BenchmarkResult>
Benchmark optimizer step performance
Measures the raw computational performance of the optimizer’s step operation across multiple iterations to get reliable timing statistics.
§Arguments
optimizer- Optimizer to benchmarkproblem_size- Number of parameters in the optimization problem
§Returns
Benchmark results with timing statistics
Sourcepub fn benchmark_quadratic_convergence<O: Optimizer>(
&self,
optimizer: O,
dimension: usize,
) -> OptimizerResult<BenchmarkResult>
pub fn benchmark_quadratic_convergence<O: Optimizer>( &self, optimizer: O, dimension: usize, ) -> OptimizerResult<BenchmarkResult>
Benchmark convergence on quadratic function
Tests how quickly the optimizer converges on a simple quadratic optimization problem. This provides insight into convergence behavior and rate.
§Arguments
optimizer- Optimizer to benchmarkdimension- Dimensionality of the optimization problem
§Returns
Benchmark results with convergence metrics
Sourcepub fn benchmark_sparse_gradients<O: Optimizer>(
&self,
optimizer: O,
total_params: usize,
sparsity: f32,
) -> OptimizerResult<BenchmarkResult>
pub fn benchmark_sparse_gradients<O: Optimizer>( &self, optimizer: O, total_params: usize, sparsity: f32, ) -> OptimizerResult<BenchmarkResult>
Benchmark sparse gradient handling
Tests optimizer performance when dealing with sparse gradients, which is common in many machine learning scenarios.
§Arguments
optimizer- Optimizer to benchmarktotal_params- Total number of parameterssparsity- Fraction of gradients that are non-zero (0.0 to 1.0)
§Returns
Benchmark results for sparse gradient performance
Sourcepub fn run_comprehensive_benchmarks<O: Optimizer + Clone>(
&self,
optimizer: O,
) -> OptimizerResult<Vec<BenchmarkResult>>
pub fn run_comprehensive_benchmarks<O: Optimizer + Clone>( &self, optimizer: O, ) -> OptimizerResult<Vec<BenchmarkResult>>
Run a comprehensive set of core benchmarks
Executes multiple benchmark scenarios to provide a complete performance profile of the optimizer including step performance, convergence, and sparse gradient handling.
§Arguments
optimizer- Optimizer to benchmark (must be cloneable)
§Returns
Vector of benchmark results covering different scenarios
Sourcepub fn print_results(&self, results: &[BenchmarkResult])
pub fn print_results(&self, results: &[BenchmarkResult])
Print benchmark results in a formatted table
Displays benchmark results in an easy-to-read tabular format with timing, convergence, and performance metrics.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OptimizerBenchmarks
impl RefUnwindSafe for OptimizerBenchmarks
impl Send for OptimizerBenchmarks
impl Sync for OptimizerBenchmarks
impl Unpin for OptimizerBenchmarks
impl UnsafeUnpin for OptimizerBenchmarks
impl UnwindSafe for OptimizerBenchmarks
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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> ⓘ
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