pub enum AssignmentMode {
Softmax {
temperature: f64,
sparsity: f64,
},
IBPMap {
temperature: f64,
alpha: f64,
learnable_alpha: bool,
},
ThresholdGate {
temperature: f64,
threshold: f64,
},
}Expand description
Assignment prior/relaxation used by SaeAssignment.
Variants§
Softmax
Row-wise simplex assignment with entropy sparsity.
IBPMap
Deterministic concrete relaxation of a truncated IBP active set: each
atom’s gate is the INDEPENDENT prior-shrunk activation
σ(logit/temperature) · π_k, with π_k = (α/(α+1))^{k+1} the
stick-breaking prior mean (see ibp_map_row). These are per-atom gates,
NOT mixture/simplex responsibilities: they are computed independently per
column and do NOT sum to 1 across atoms (there is no row normalization).
Each a_k ∈ [0, π_k] ⊂ [0, 1) is the relaxed “atom k is active in this
row” indicator of a truncated IBP, not a share of a unit reconstruction
budget.
ThresholdGate
Hard-thresholded bounded gate: each atom is off (gate = 0) when its logit
is at or below threshold, and on with a threshold-centered shifted
sigmoid σ((logit − threshold) / temperature) ∈ [0.5, 1) above it.
#1777 RENAMED from JumpReLU (an inaccurate name): this is NOT the
literature JumpReLU activation z·1[z>θ], which carries the thresholded
MAGNITUDE z. This mode is a thresholded-logistic GATE (a hard-sigmoid
gate): it carries no magnitude at all — its output is a bounded [0, 1)
indicator. ThresholdGate names it for what it is. It is a member of the
gate family (softmax simplex / IBP sigmoid / this hard gate); reconstruction
magnitude lives entirely in the decoder curve g_k(t) = φ(t)ᵀ B_k. The
discontinuity at threshold (0 → 0.5) is the intended “jump”.
BACK-COMPAT: the constructor Self::threshold_gate is the primary
spelling; Self::jumprelu is retained as a deprecated alias, and the FFI
string parser accepts both "threshold_gate" and the legacy "jumprelu".
Implementations§
Source§impl AssignmentMode
impl AssignmentMode
pub fn softmax(temperature: f64) -> Self
pub fn ibp_map(temperature: f64, alpha: f64, learnable_alpha: bool) -> Self
Sourcepub fn threshold_gate(temperature: f64, threshold: f64) -> Self
pub fn threshold_gate(temperature: f64, threshold: f64) -> Self
#1777 — construct the hard-sigmoid Self::ThresholdGate (the accurate
name for what was jumprelu). Primary spelling; Self::jumprelu is a
deprecated alias kept for back-compat.
Sourcepub fn jumprelu(temperature: f64, threshold: f64) -> Self
pub fn jumprelu(temperature: f64, threshold: f64) -> Self
Back-compat alias for Self::threshold_gate (#1777): the mode is a
hard-sigmoid gate, not the literature JumpReLU magnitude activation. Retained
(NOT #[deprecated], since the workspace denies warnings and many callers
and the legacy "jumprelu" FFI token still use it) so existing code keeps
compiling; new code should prefer threshold_gate.
pub fn temperature(&self) -> f64
Trait Implementations§
Source§impl Clone for AssignmentMode
impl Clone for AssignmentMode
Source§fn clone(&self) -> AssignmentMode
fn clone(&self) -> AssignmentMode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for AssignmentMode
Auto Trait Implementations§
impl Freeze for AssignmentMode
impl RefUnwindSafe for AssignmentMode
impl Send for AssignmentMode
impl Sync for AssignmentMode
impl Unpin for AssignmentMode
impl UnsafeUnpin for AssignmentMode
impl UnwindSafe for AssignmentMode
Blanket Implementations§
impl<T> Allocation 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
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>
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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.