pub struct LoRAEngine {
pub micro: MicroLoRA,
pub base: BaseLoRA,
pub micro_enabled: bool,
pub base_enabled: bool,
}Expand description
Combined LoRA engine managing both tiers
Fields§
§micro: MicroLoRAMicro-LoRA for instant adaptation
base: BaseLoRABase LoRA for background adaptation
micro_enabled: boolWhether micro-LoRA is enabled
base_enabled: boolWhether base LoRA is enabled
Implementations§
Source§impl LoRAEngine
impl LoRAEngine
Sourcepub fn new(
hidden_dim: usize,
micro_rank: usize,
base_rank: usize,
num_layers: usize,
) -> Self
pub fn new( hidden_dim: usize, micro_rank: usize, base_rank: usize, num_layers: usize, ) -> Self
Create new LoRA engine
Sourcepub fn forward(&self, layer_idx: usize, input: &[f32], output: &mut [f32])
pub fn forward(&self, layer_idx: usize, input: &[f32], output: &mut [f32])
Apply both LoRA tiers
Sourcepub fn accumulate_micro(&mut self, signal: &LearningSignal)
pub fn accumulate_micro(&mut self, signal: &LearningSignal)
Accumulate micro-LoRA gradient
Sourcepub fn apply_micro(&mut self, learning_rate: f32)
pub fn apply_micro(&mut self, learning_rate: f32)
Apply micro-LoRA updates
Trait Implementations§
Source§impl Clone for LoRAEngine
impl Clone for LoRAEngine
Source§fn clone(&self) -> LoRAEngine
fn clone(&self) -> LoRAEngine
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for LoRAEngine
impl RefUnwindSafe for LoRAEngine
impl Send for LoRAEngine
impl Sync for LoRAEngine
impl Unpin for LoRAEngine
impl UnwindSafe for LoRAEngine
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