pub struct LogitAdjustment { /* private fields */ }Expand description
A vector subtracted from target logits to steer away from unsafe output. Sparse and integer (milli-logits) for deterministic, allocation-light steps.
Implementations§
Source§impl LogitAdjustment
impl LogitAdjustment
pub fn none() -> LogitAdjustment
pub fn with_penalties(penalties: Vec<(u32, i32)>) -> LogitAdjustment
pub fn is_empty(&self) -> bool
Sourcepub fn delta_for(&self, token: u32) -> i32
pub fn delta_for(&self, token: u32) -> i32
The milli-logit delta to add for token (0 if unaffected).
Sourcepub fn l1_norm_milli(&self) -> u32
pub fn l1_norm_milli(&self) -> u32
L1 norm in milli-units — what LogitsSteered.adjustment_norm_milli
reports to telemetry.
Trait Implementations§
Source§impl Clone for LogitAdjustment
impl Clone for LogitAdjustment
Source§fn clone(&self) -> LogitAdjustment
fn clone(&self) -> LogitAdjustment
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 moreSource§impl Debug for LogitAdjustment
impl Debug for LogitAdjustment
Source§impl Default for LogitAdjustment
impl Default for LogitAdjustment
Source§fn default() -> LogitAdjustment
fn default() -> LogitAdjustment
Returns the “default value” for a type. Read more
impl Eq for LogitAdjustment
Source§impl PartialEq for LogitAdjustment
impl PartialEq for LogitAdjustment
Source§fn eq(&self, other: &LogitAdjustment) -> bool
fn eq(&self, other: &LogitAdjustment) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for LogitAdjustment
Auto Trait Implementations§
impl Freeze for LogitAdjustment
impl RefUnwindSafe for LogitAdjustment
impl Send for LogitAdjustment
impl Sync for LogitAdjustment
impl Unpin for LogitAdjustment
impl UnsafeUnpin for LogitAdjustment
impl UnwindSafe for LogitAdjustment
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