pub struct FlowDenoiser { /* private fields */ }Expand description
Trainable flow/diffusion denoiser with optional condition features and CFG.
Implementations§
Source§impl FlowDenoiser
impl FlowDenoiser
pub fn new_with_seed(config: FlowDenoiserConfig, seed: u64) -> Result<Self>
Sourcepub fn new_with_seed_on(
runtime: &Runtime,
config: FlowDenoiserConfig,
seed: u64,
) -> Result<Self>
pub fn new_with_seed_on( runtime: &Runtime, config: FlowDenoiserConfig, seed: u64, ) -> Result<Self>
Construct a deterministic dense or MoE denoiser.
§Errors
Returns an error for invalid model/time/dropout geometry or failed child, parameter, and buffer construction.
Sourcepub fn forward(&self, sample: &Matrix) -> Result<Matrix>
pub fn forward(&self, sample: &Matrix) -> Result<Matrix>
Denoise using zero time and, when configured, zero condition features.
Sourcepub fn forward_conditioned(
&self,
sample: &Matrix,
time: &Matrix,
condition: Option<&Matrix>,
token_mask: Option<&Matrix>,
) -> Result<Matrix>
pub fn forward_conditioned( &self, sample: &Matrix, time: &Matrix, condition: Option<&Matrix>, token_mask: Option<&Matrix>, ) -> Result<Matrix>
Denoise a sample with explicit time, optional condition, and token mask.
§Errors
Returns an error unless inputs match the configured same-runtime F32 contracts or a recorded child operation fails.
Sourcepub fn forward_guided(
&self,
sample: &Matrix,
time: &Matrix,
condition: &Matrix,
guidance_scale: f32,
token_mask: Option<&Matrix>,
) -> Result<Matrix>
pub fn forward_guided( &self, sample: &Matrix, time: &Matrix, condition: &Matrix, guidance_scale: f32, token_mask: Option<&Matrix>, ) -> Result<Matrix>
Apply classifier-free guidance in a bounded evaluation-mode scope.
pub const fn config(&self) -> FlowDenoiserConfig
pub fn is_moe(&self) -> bool
pub fn backbone(&self) -> &FlowTransformer
pub fn position(&self) -> Parameter
Trait Implementations§
Source§impl Module for FlowDenoiser
impl Module for FlowDenoiser
Source§fn forward(&self, input: &Matrix) -> Result<Matrix>
fn forward(&self, input: &Matrix) -> Result<Matrix>
Evaluate one Matrix input without submitting or waiting.
Source§fn registry(&self) -> &ModuleRegistry
fn registry(&self) -> &ModuleRegistry
Return this module’s structural registry.
Source§fn parameters(&self) -> Vec<Parameter>
fn parameters(&self) -> Vec<Parameter>
Return direct parameters only.
Source§fn named_parameters(&self) -> Vec<NamedParameter>
fn named_parameters(&self) -> Vec<NamedParameter>
Return direct parameters with local registration names.
Source§fn named_buffers(&self) -> Vec<NamedBuffer>
fn named_buffers(&self) -> Vec<NamedBuffer>
Return direct buffers with local registration names and persistence flags.
Source§fn all_parameters(&self) -> Result<Vec<Parameter>>
fn all_parameters(&self) -> Result<Vec<Parameter>>
Return every parameter exactly once in deterministic depth-first order. Read more
Source§fn all_named_parameters(&self) -> Result<Vec<NamedParameter>>
fn all_named_parameters(&self) -> Result<Vec<NamedParameter>>
Return every parameter with its registration-derived dotted path. Read more
Source§fn all_named_buffers(&self) -> Result<Vec<NamedBuffer>>
fn all_named_buffers(&self) -> Result<Vec<NamedBuffer>>
Return all direct and recursive buffers in deterministic depth-first order. Read more
Source§fn all_named_state_u32(&self) -> Result<Vec<NamedStateU32>>
fn all_named_state_u32(&self) -> Result<Vec<NamedStateU32>>
Return all direct and recursive persistent
u32 scalar state in
deterministic depth-first order. Read moreSource§fn all_named_rng_states(&self) -> Result<Vec<NamedRngState>>
fn all_named_rng_states(&self) -> Result<Vec<NamedRngState>>
Return all direct and recursive stochastic RNG streams in deterministic
depth-first order. Read more
Source§fn num_parameters(&self) -> Result<usize>
fn num_parameters(&self) -> Result<usize>
Return the total number of trainable scalar values. Read more
Source§fn is_training(&self) -> bool
fn is_training(&self) -> bool
Return this module’s current train/eval mode.
Source§fn scoped_eval(&self) -> ScopedEval<'_>
fn scoped_eval(&self) -> ScopedEval<'_>
Enter evaluation mode until the returned guard is dropped.
Auto Trait Implementations§
impl !Freeze for FlowDenoiser
impl !RefUnwindSafe for FlowDenoiser
impl !Send for FlowDenoiser
impl !Sync for FlowDenoiser
impl !UnwindSafe for FlowDenoiser
impl Forget for FlowDenoiser
impl Move for FlowDenoiser
impl Unpin for FlowDenoiser
impl UnsafeUnpin for FlowDenoiserwhere
*const RcInner<Linear> is !null: UnsafeUnpin,
PhantomData<RcInner<Linear>>: UnsafeUnpin,
*const RcInner<FlowTimeEmbedding> is !null: UnsafeUnpin,
PhantomData<RcInner<FlowTimeEmbedding>>: UnsafeUnpin,
*const RcInner<FlowTransformer> is !null: UnsafeUnpin,
PhantomData<RcInner<FlowTransformer>>: UnsafeUnpin,
*const RcInner<RefCell<ParameterState>> is !null: UnsafeUnpin,
PhantomData<RcInner<RefCell<ParameterState>>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<ParameterEntry>: UnsafeUnpin,
PhantomData<BufferEntry>: UnsafeUnpin,
PhantomData<StateU32Entry>: UnsafeUnpin,
PhantomData<RngStateEntry>: UnsafeUnpin,
PhantomData<ChildEntry>: UnsafeUnpin,
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