pub enum Config {
Show 24 variants
Attention(AttentionConfig),
BatchNorm(BatchNormConfig),
Bias(BiasConfig),
Cache(CacheConfig),
Cat(CatLayer),
Conv2d(Conv2dConfig),
CrossEntropy(CrossEntropyLossConfig),
Dropout(DropoutConfig),
Embedding(EmbeddingConfig),
Flatten(FlattenLayer<Range<isize>>),
KQV(KQVConfig),
LayerNorm(LayerNormConfig),
Linear(LinearConfig),
MaxPool2d(MaxPool2dConfig),
Mse,
Relu,
Reshape(ReshapeLayer<Reshape>),
Rotary(RotaryEncodingConfig),
ScaleShift(ScaleShiftConfig),
Squeeze(SqueezeLayer),
Stack(StackLayer),
Sum(SumLayer),
Tanh,
Unsqueeze(UnsqueezeLayer),
}Expand description
enumerates config for some burn layers
Variants§
Attention(AttentionConfig)
BatchNorm(BatchNormConfig)
Bias(BiasConfig)
Cache(CacheConfig)
Cat(CatLayer)
Conv2d(Conv2dConfig)
CrossEntropy(CrossEntropyLossConfig)
Dropout(DropoutConfig)
Embedding(EmbeddingConfig)
Flatten(FlattenLayer<Range<isize>>)
KQV(KQVConfig)
LayerNorm(LayerNormConfig)
Linear(LinearConfig)
MaxPool2d(MaxPool2dConfig)
Mse
Relu
Reshape(ReshapeLayer<Reshape>)
Rotary(RotaryEncodingConfig)
ScaleShift(ScaleShiftConfig)
Squeeze(SqueezeLayer)
Stack(StackLayer)
Sum(SumLayer)
Tanh
Unsqueeze(UnsqueezeLayer)
Implementations§
Source§impl Config
impl Config
Sourcepub fn attention(heads: usize, mask: AttentionMask) -> Self
pub fn attention(heads: usize, mask: AttentionMask) -> Self
creates an attention config
Sourcepub fn batch_norm(countfeatures: usize, epsilon: f32, momentum: f32) -> Self
pub fn batch_norm(countfeatures: usize, epsilon: f32, momentum: f32) -> Self
creates a batch norm config
Sourcepub fn flatten<R: RangeBounds<isize>>(dims: R) -> Self
pub fn flatten<R: RangeBounds<isize>>(dims: R) -> Self
creates a flatten config
Sourcepub fn layer_norm(dim: usize) -> Self
pub fn layer_norm(dim: usize) -> Self
creates a layer norm config
Sourcepub fn max_pool_2d(kernel: [usize; 2], strides: [usize; 2]) -> Self
pub fn max_pool_2d(kernel: [usize; 2], strides: [usize; 2]) -> Self
creates a max pool 2d config
Sourcepub fn scale_shift() -> Self
pub fn scale_shift() -> Self
creates a scale shift config
Sourcepub fn set_attention_dropout(&mut self, dropout: f32) -> bool
pub fn set_attention_dropout(&mut self, dropout: f32) -> bool
sets the dropout if this is an attention layer
Trait Implementations§
Source§impl Config for Config
impl Config for Config
Source§fn load<P>(file: P) -> Result<Self, ConfigError>
fn load<P>(file: P) -> Result<Self, ConfigError>
Loads the configuration from a file. Read more
Source§fn load_binary(data: &[u8]) -> Result<Self, ConfigError>
fn load_binary(data: &[u8]) -> Result<Self, ConfigError>
Loads the configuration from a binary buffer. Read more
Source§impl Decompose for Config
impl Decompose for Config
Source§type Decomposition = Config
type Decomposition = Config
the decomposed type
Source§fn compose(decomposition: Self::Decomposition) -> Self
fn compose(decomposition: Self::Decomposition) -> Self
recreates from the decomposition
Source§fn decompose(self) -> Self::Decomposition
fn decompose(self) -> Self::Decomposition
owned decomposition
Source§fn decompose_cloned(&self) -> Self::Decomposition
fn decompose_cloned(&self) -> Self::Decomposition
decomposition that copies data
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<AttentionConfig> for Config
impl From<AttentionConfig> for Config
Source§fn from(value: AttentionConfig) -> Self
fn from(value: AttentionConfig) -> Self
Converts to this type from the input type.
Source§impl From<BatchNormConfig> for Config
impl From<BatchNormConfig> for Config
Source§fn from(value: BatchNormConfig) -> Self
fn from(value: BatchNormConfig) -> Self
Converts to this type from the input type.
Source§impl From<BiasConfig> for Config
impl From<BiasConfig> for Config
Source§fn from(value: BiasConfig) -> Self
fn from(value: BiasConfig) -> Self
Converts to this type from the input type.
Source§impl From<CrossEntropyLossConfig> for Config
impl From<CrossEntropyLossConfig> for Config
Source§fn from(value: CrossEntropyLossConfig) -> Self
fn from(value: CrossEntropyLossConfig) -> Self
Converts to this type from the input type.
Source§impl From<DropoutConfig> for Config
impl From<DropoutConfig> for Config
Source§fn from(value: DropoutConfig) -> Self
fn from(value: DropoutConfig) -> Self
Converts to this type from the input type.
Source§impl From<EmbeddingConfig> for Config
impl From<EmbeddingConfig> for Config
Source§fn from(value: EmbeddingConfig) -> Self
fn from(value: EmbeddingConfig) -> Self
Converts to this type from the input type.
Source§impl From<LayerNormConfig> for Config
impl From<LayerNormConfig> for Config
Source§fn from(value: LayerNormConfig) -> Self
fn from(value: LayerNormConfig) -> Self
Converts to this type from the input type.
Source§impl From<LinearConfig> for Config
impl From<LinearConfig> for Config
Source§fn from(value: LinearConfig) -> Self
fn from(value: LinearConfig) -> Self
Converts to this type from the input type.
Source§impl From<MaxPool2dConfig> for Config
impl From<MaxPool2dConfig> for Config
Source§fn from(value: MaxPool2dConfig) -> Self
fn from(value: MaxPool2dConfig) -> Self
Converts to this type from the input type.
Source§impl From<ReshapeLayer<Reshape>> for Config
impl From<ReshapeLayer<Reshape>> for Config
Source§fn from(value: ReshapeLayer<Reshape>) -> Self
fn from(value: ReshapeLayer<Reshape>) -> Self
Converts to this type from the input type.
Source§impl From<RotaryEncodingConfig> for Config
impl From<RotaryEncodingConfig> for Config
Source§fn from(value: RotaryEncodingConfig) -> Self
fn from(value: RotaryEncodingConfig) -> Self
Converts to this type from the input type.
Source§impl From<SqueezeLayer> for Config
impl From<SqueezeLayer> for Config
Source§fn from(value: SqueezeLayer) -> Self
fn from(value: SqueezeLayer) -> Self
Converts to this type from the input type.
Source§impl From<StackLayer> for Config
impl From<StackLayer> for Config
Source§fn from(value: StackLayer) -> Self
fn from(value: StackLayer) -> Self
Converts to this type from the input type.
Source§impl From<UnsqueezeLayer> for Config
impl From<UnsqueezeLayer> for Config
Source§fn from(value: UnsqueezeLayer) -> Self
fn from(value: UnsqueezeLayer) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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> 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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more