Struct SegmentPlan
pub struct SegmentPlan { /* private fields */ }Expand description
An immutable, bounded segmentation policy.
Implementations§
§impl SegmentPlan
impl SegmentPlan
pub fn new(total_steps: u64, segment_steps: u64) -> Result<Self>
pub fn new(total_steps: u64, segment_steps: u64) -> Result<Self>
Builds a plan that trains total_steps in segment_steps chunks.
§Errors
Returns SpikeError::Segment if either step count is zero, if the
default fidelity would require more than MAX_SEGMENTS segments, or
if the segment count cannot fit in usize.
pub const fn total_steps(&self) -> u64
pub const fn total_steps(&self) -> u64
The default full-fidelity budget.
pub const fn segment_steps(&self) -> u64
pub const fn segment_steps(&self) -> u64
The stride used for every non-final segment.
pub fn segments(&self) -> Result<Vec<Segment>>
pub fn segments(&self) -> Result<Vec<Segment>>
Derives segments for the plan’s default fidelity.
§Errors
Returns SpikeError::Segment if the default fidelity cannot be
represented as a bounded segment list.
pub fn segments_for(&self, total_steps: u64) -> Result<Vec<Segment>>
pub fn segments_for(&self, total_steps: u64) -> Result<Vec<Segment>>
Derives a bounded segment list for one trial fidelity.
§Errors
Returns SpikeError::Segment if total_steps is zero, if the
fidelity would require more than MAX_SEGMENTS segments, or if the
segment count cannot fit in usize.
Trait Implementations§
§impl Clone for SegmentPlan
impl Clone for SegmentPlan
§fn clone(&self) -> SegmentPlan
fn clone(&self) -> SegmentPlan
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SegmentPlan
§impl Debug for SegmentPlan
impl Debug for SegmentPlan
impl Eq for SegmentPlan
§impl PartialEq for SegmentPlan
impl PartialEq for SegmentPlan
impl StructuralPartialEq for SegmentPlan
Auto Trait Implementations§
impl Freeze for SegmentPlan
impl RefUnwindSafe for SegmentPlan
impl Send for SegmentPlan
impl Sync for SegmentPlan
impl Unpin for SegmentPlan
impl UnsafeUnpin for SegmentPlan
impl UnwindSafe for SegmentPlan
Blanket Implementations§
impl<T> Boilerplate for T
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