pub struct Moe {
pub experts: usize,
pub top_k: usize,
pub expert_dff: usize,
pub act: Act,
pub gating: Gating,
pub norm_top_k: bool,
pub weights_scale: f64,
pub shared_experts: usize,
pub shared_dff: usize,
pub shared_gate: bool,
pub biases: bool,
pub groups: Option<(usize, usize)>,
}Expand description
A mixture of experts.
Fields§
§experts: usize§top_k: usize§expert_dff: usize§act: Act§gating: Gating§norm_top_k: boolThe chosen experts’ weights are renormalized to sum to one.
weights_scale: f64A scale applied to the routing weights.
The shared experts’ output scaled by σ(x·g), g the checkpoint’s ffn_gate_inp_shexp (Qwen’s mixtures).
biases: boolBiases on the router and on every expert’s projections (gpt-oss).
groups: Option<(usize, usize)>Experts chosen within groups (DeepSeek V3): the experts split into groups of equal size, each group scored
by its two best experts, only the best used groups’ experts eligible for the top-k.
Trait Implementations§
impl StructuralPartialEq for Moe
Auto Trait Implementations§
impl Freeze for Moe
impl RefUnwindSafe for Moe
impl Send for Moe
impl Sync for Moe
impl Unpin for Moe
impl UnsafeUnpin for Moe
impl UnwindSafe for Moe
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,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.