burn::prelude

Trait Config

pub trait Config: Serialize + DeserializeOwned {
    // Provided methods
    fn save<P>(&self, file: P) -> Result<(), Error>
       where P: AsRef<Path> { ... }
    fn load<P>(file: P) -> Result<Self, ConfigError>
       where P: AsRef<Path> { ... }
    fn load_binary(data: &[u8]) -> Result<Self, ConfigError> { ... }
}
Expand description

Configuration trait.

Provided Methods§

fn save<P>(&self, file: P) -> Result<(), Error>
where P: AsRef<Path>,

Saves the configuration to a file.

§Arguments
  • file - File to save the configuration to.
§Returns

The output of the save operation.

fn load<P>(file: P) -> Result<Self, ConfigError>
where P: AsRef<Path>,

Loads the configuration from a file.

§Arguments
  • file - File to load the configuration from.
§Returns

The loaded configuration.

fn load_binary(data: &[u8]) -> Result<Self, ConfigError>

Loads the configuration from a binary buffer.

§Arguments
  • data - Binary buffer to load the configuration from.
§Returns

The loaded configuration.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

§

impl Config for GradientClippingConfig

§

impl Config for Initializer

§

impl Config for PaddingConfig1d

§

impl Config for PaddingConfig2d

§

impl Config for PaddingConfig3d

§

impl Config for CosineAnnealingLrSchedulerConfig

§

impl Config for ExponentialLrSchedulerConfig

§

impl Config for LinearLrSchedulerConfig

§

impl Config for NoamLrSchedulerConfig

§

impl Config for StepLrSchedulerConfig

§

impl Config for MultiHeadAttentionConfig

§

impl Config for Conv1dConfig

§

impl Config for Conv2dConfig

§

impl Config for Conv3dConfig

§

impl Config for ConvTranspose1dConfig

§

impl Config for ConvTranspose2dConfig

§

impl Config for ConvTranspose3dConfig

§

impl Config for DeformConv2dConfig

§

impl Config for GruConfig

§

impl Config for Interpolate1dConfig

§

impl Config for Interpolate2dConfig

§

impl Config for BinaryCrossEntropyLossConfig

§

impl Config for CrossEntropyLossConfig

§

impl Config for HuberLossConfig

§

impl Config for AdaptiveAvgPool1dConfig

§

impl Config for AdaptiveAvgPool2dConfig

§

impl Config for AvgPool1dConfig

§

impl Config for AvgPool2dConfig

§

impl Config for MaxPool1dConfig

§

impl Config for MaxPool2dConfig

§

impl Config for BatchNormConfig

§

impl Config for BiLstmConfig

§

impl Config for DropoutConfig

§

impl Config for EmbeddingConfig

§

impl Config for GroupNormConfig

§

impl Config for HardSigmoidConfig

§

impl Config for InstanceNormConfig

§

impl Config for LayerNormConfig

§

impl Config for LeakyReluConfig

§

impl Config for LinearConfig

§

impl Config for LstmConfig

§

impl Config for PReluConfig

§

impl Config for PositionalEncodingConfig

§

impl Config for RmsNormConfig

§

impl Config for RotaryEncodingConfig

§

impl Config for SwiGluConfig

§

impl Config for Unfold4dConfig

§

impl Config for PositionWiseFeedForwardConfig

§

impl Config for TransformerDecoderConfig

§

impl Config for TransformerEncoderConfig

§

impl Config for WeightDecayConfig

§

impl Config for MomentumConfig

§

impl Config for AdaGradConfig

§

impl Config for AdamConfig

§

impl Config for AdamWConfig

§

impl Config for RmsPropConfig

§

impl Config for SgdConfig