pub struct ParameterCollection { /* private fields */ }Expand description
Parameter collection utility for managing multiple parameters
This provides convenient methods for working with collections of parameters, such as applying operations to all parameters in a module.
Implementations§
Source§impl ParameterCollection
impl ParameterCollection
Sourcepub fn get_mut(&mut self, name: &str) -> Option<&mut Parameter>
pub fn get_mut(&mut self, name: &str) -> Option<&mut Parameter>
Get a mutable parameter by name
Sourcepub fn apply_to_all<F>(&mut self, f: F) -> Result<()>
pub fn apply_to_all<F>(&mut self, f: F) -> Result<()>
Apply a function to all parameters
Sourcepub fn stats(&self) -> Result<HashMap<String, ParameterStats>>
pub fn stats(&self) -> Result<HashMap<String, ParameterStats>>
Get statistics for all parameters
Sourcepub fn diagnose(&self) -> Result<HashMap<String, ParameterDiagnostics>>
pub fn diagnose(&self) -> Result<HashMap<String, ParameterDiagnostics>>
Get diagnostics for all parameters
Sourcepub fn total_parameters(&self) -> usize
pub fn total_parameters(&self) -> usize
Get total parameter count
Sourcepub fn total_memory_usage(&self) -> usize
pub fn total_memory_usage(&self) -> usize
Get total memory usage
Sourcepub fn freeze_all(&mut self)
pub fn freeze_all(&mut self)
Freeze all parameters
Sourcepub fn unfreeze_all(&mut self)
pub fn unfreeze_all(&mut self)
Unfreeze all parameters
Sourcepub fn add_noise_all(&mut self, std: f32) -> Result<()>
pub fn add_noise_all(&mut self, std: f32) -> Result<()>
Add noise to all parameters
Sourcepub fn filter_by_name(&self, pattern: &str) -> ParameterCollection
pub fn filter_by_name(&self, pattern: &str) -> ParameterCollection
Filter parameters by name pattern
Sourcepub fn filter_by<F>(&self, predicate: F) -> ParameterCollection
pub fn filter_by<F>(&self, predicate: F) -> ParameterCollection
Filter parameters by predicate
Sourcepub fn summary_report(&self) -> Result<String>
pub fn summary_report(&self) -> Result<String>
Create a summary report of all parameters
Trait Implementations§
Source§impl Clone for ParameterCollection
impl Clone for ParameterCollection
Source§fn clone(&self) -> ParameterCollection
fn clone(&self) -> ParameterCollection
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ParameterCollection
impl Debug for ParameterCollection
Source§impl Default for ParameterCollection
impl Default for ParameterCollection
Source§impl From<ParameterCollection> for HashMap<String, Parameter>
impl From<ParameterCollection> for HashMap<String, Parameter>
Source§fn from(val: ParameterCollection) -> Self
fn from(val: ParameterCollection) -> Self
Converts to this type from the input type.
Source§impl ParameterCollectionExt for ParameterCollection
impl ParameterCollectionExt for ParameterCollection
Source§fn total_numel(&self) -> usize
fn total_numel(&self) -> usize
Get total parameter count
Source§fn group_by_patterns(
&self,
groups: &HashMap<String, Vec<String>>,
) -> HashMap<String, ParameterGroup>
fn group_by_patterns( &self, groups: &HashMap<String, Vec<String>>, ) -> HashMap<String, ParameterGroup>
Group parameters by name pattern
Auto Trait Implementations§
impl Freeze for ParameterCollection
impl !RefUnwindSafe for ParameterCollection
impl Send for ParameterCollection
impl Sync for ParameterCollection
impl Unpin for ParameterCollection
impl UnsafeUnpin for ParameterCollection
impl !UnwindSafe for ParameterCollection
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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