pub struct OftConfig {
pub r: usize,
pub coft: bool,
pub eps: f64,
pub block_share: bool,
pub target_modules: Vec<String>,
pub use_exact_cayley: bool,
}Expand description
Configuration for OFT adapters.
Fields§
§r: usizeNumber of OFT blocks (determines expressiveness vs efficiency).
coft: boolWhether to use constrained OFT (COFT) which enforces strict orthogonality.
eps: f64Small constant for numerical stability.
Block sharing across layers.
target_modules: Vec<String>Target modules to apply OFT to.
use_exact_cayley: boolWhether to use exact Cayley transform computation.
When false (default), uses a Neumann series approximation (I + Q)^{-1} ≈ I - Q + Q^2
which is efficient but less accurate for larger Q values.
When true, computes the exact inverse using Newton-Schulz iteration,
providing higher accuracy at the cost of additional computation.
Trait Implementations§
Source§impl AdapterConfig for OftConfig
impl AdapterConfig for OftConfig
Source§impl<'de> Deserialize<'de> for OftConfig
impl<'de> Deserialize<'de> for OftConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<OftConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<OftConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for OftConfig
impl Serialize for OftConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for OftConfig
impl RefUnwindSafe for OftConfig
impl Send for OftConfig
impl Sync for OftConfig
impl Unpin for OftConfig
impl UnwindSafe for OftConfig
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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 more