Struct burn_core::nn::loss::CrossEntropyLossConfig
source · pub struct CrossEntropyLossConfig { /* private fields */ }Expand description
Configuration to create a Cross-entropy loss.
Implementations§
source§impl CrossEntropyLossConfig
impl CrossEntropyLossConfig
sourcepub fn with_logits(self, logits: bool) -> Self
pub fn with_logits(self, logits: bool) -> Self
Create cross-entropy with probabilities as input instead of logits.
sourcepub fn with_pad_tokens(self, pad_tokens: Option<Vec<usize>>) -> Self
pub fn with_pad_tokens(self, pad_tokens: Option<Vec<usize>>) -> Self
Set the default value for the field.
sourcepub fn with_weights(self, weights: Option<Vec<f32>>) -> Self
pub fn with_weights(self, weights: Option<Vec<f32>>) -> Self
Set the default value for the field.
sourcepub fn with_smoothing(self, smoothing: Option<f32>) -> Self
pub fn with_smoothing(self, smoothing: Option<f32>) -> Self
Set the default value for the field.
source§impl CrossEntropyLossConfig
impl CrossEntropyLossConfig
sourcepub fn init<B: Backend>(&self) -> CrossEntropyLoss<B>
pub fn init<B: Backend>(&self) -> CrossEntropyLoss<B>
Initialize Cross-entropy loss.
Trait Implementations§
source§impl Clone for CrossEntropyLossConfig
impl Clone for CrossEntropyLossConfig
source§impl Config for CrossEntropyLossConfig
impl Config for CrossEntropyLossConfig
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 CrossEntropyLossConfig
impl Debug for CrossEntropyLossConfig
source§impl<'de> Deserialize<'de> for CrossEntropyLossConfig
impl<'de> Deserialize<'de> for CrossEntropyLossConfig
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 CrossEntropyLossConfig
impl Display for CrossEntropyLossConfig
Auto Trait Implementations§
impl RefUnwindSafe for CrossEntropyLossConfig
impl Send for CrossEntropyLossConfig
impl Sync for CrossEntropyLossConfig
impl Unpin for CrossEntropyLossConfig
impl UnwindSafe for CrossEntropyLossConfig
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