Struct burn_core::nn::LinearConfig
source · pub struct LinearConfig {
pub d_input: usize,
pub d_output: usize,
pub bias: bool,
pub initializer: Initializer,
}Expand description
Configuration to create a Linear layer.
Fields§
§d_input: usizeThe size of the input features.
d_output: usizeThe size of the output features.
bias: boolIf a bias should be applied during the linear transformation.
initializer: InitializerThe type of function used to initialize neural network parameters
Implementations§
source§impl LinearConfig
impl LinearConfig
source§impl LinearConfig
impl LinearConfig
sourcepub fn with_bias(self, bias: bool) -> Self
pub fn with_bias(self, bias: bool) -> Self
If a bias should be applied during the linear transformation.
sourcepub fn with_initializer(self, initializer: Initializer) -> Self
pub fn with_initializer(self, initializer: Initializer) -> Self
The type of function used to initialize neural network parameters
Trait Implementations§
source§impl Clone for LinearConfig
impl Clone for LinearConfig
source§impl Config for LinearConfig
impl Config for LinearConfig
source§fn save<P: AsRef<Path>>(&self, file: P) -> Result<()>
fn save<P: AsRef<Path>>(&self, file: P) -> Result<()>
Saves the configuration to a file. Read more
source§fn load<P: AsRef<Path>>(file: P) -> Result<Self, ConfigError>
fn load<P: AsRef<Path>>(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 Debug for LinearConfig
impl Debug for LinearConfig
source§impl<'de> Deserialize<'de> for LinearConfig
impl<'de> Deserialize<'de> for LinearConfig
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 Display for LinearConfig
impl Display for LinearConfig
Auto Trait Implementations§
impl RefUnwindSafe for LinearConfig
impl Send for LinearConfig
impl Sync for LinearConfig
impl Unpin for LinearConfig
impl UnwindSafe for LinearConfig
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