pub struct FcdStream<'a> {
pub ids: &'a [u32],
pub weight: Option<&'a [f32]>,
pub starts: Option<&'a [usize]>,
}Expand description
A training or validation token stream for the polish.
weight[i] scales the loss of predicting ids[i] (0 = context only),
so an answer-only loss is a stream whose prompt tokens weigh 0.
starts marks record boundaries (ascending, starts[0] == 0): a window
then begins inside one record and nothing past that record’s end is
scored, so one prompt’s answer is never trained on another’s context.
Without either, the stream is plain text and every position counts —
exactly the original corpus behaviour.
Fields§
§ids: &'a [u32]§weight: Option<&'a [f32]>§starts: Option<&'a [usize]>Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for FcdStream<'a>
impl<'a> RefUnwindSafe for FcdStream<'a>
impl<'a> Send for FcdStream<'a>
impl<'a> Sync for FcdStream<'a>
impl<'a> Unpin for FcdStream<'a>
impl<'a> UnsafeUnpin for FcdStream<'a>
impl<'a> UnwindSafe for FcdStream<'a>
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