pub struct LossLandscape {
pub values: Vec<f32>,
pub width: usize,
pub height: usize,
pub x_range: (f32, f32),
pub y_range: (f32, f32),
}Expand description
A 2D grid of loss values sampled along two parameter directions.
Fields§
§values: Vec<f32>Loss values in row-major order (height x width).
width: usize§height: usize§x_range: (f32, f32)Range of the x-axis parameter.
y_range: (f32, f32)Range of the y-axis parameter.
Implementations§
Source§impl LossLandscape
impl LossLandscape
pub fn new( width: usize, height: usize, x_range: (f32, f32), y_range: (f32, f32), ) -> Self
pub fn set(&mut self, x: usize, y: usize, val: f32)
pub fn get(&self, x: usize, y: usize) -> f32
pub fn min_loss(&self) -> f32
pub fn max_loss(&self) -> f32
Sourcepub fn generate_synthetic(width: usize, height: usize) -> Self
pub fn generate_synthetic(width: usize, height: usize) -> Self
Generate a synthetic loss landscape (for testing/demo). Uses a sum-of-Gaussians to create a bowl-like landscape.
Trait Implementations§
Source§impl Clone for LossLandscape
impl Clone for LossLandscape
Source§fn clone(&self) -> LossLandscape
fn clone(&self) -> LossLandscape
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 moreAuto Trait Implementations§
impl Freeze for LossLandscape
impl RefUnwindSafe for LossLandscape
impl Send for LossLandscape
impl Sync for LossLandscape
impl Unpin for LossLandscape
impl UnsafeUnpin for LossLandscape
impl UnwindSafe for LossLandscape
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.