pub struct BinaryCrossEntropyLossConfig {
pub logits: bool,
}Expand description
Configuration to create a Binary Cross-entropy loss using the init function.
Fields§
§logits: boolTreat the inputs as logits, applying a sigmoid activation when computing the loss.
Implementations§
Source§impl BinaryCrossEntropyLossConfig
impl BinaryCrossEntropyLossConfig
Sourcepub fn with_logits(self, logits: bool) -> Self
pub fn with_logits(self, logits: bool) -> Self
Sets the value for the field logits.
Treat the inputs as logits, applying a sigmoid activation when computing the loss.
- Defaults to
false
Source§impl BinaryCrossEntropyLossConfig
impl BinaryCrossEntropyLossConfig
Sourcepub fn init(&self) -> BinaryCrossEntropyLoss
pub fn init(&self) -> BinaryCrossEntropyLoss
Initialize Binary Cross-entropy loss.
Trait Implementations§
Source§impl Clone for BinaryCrossEntropyLossConfig
impl Clone for BinaryCrossEntropyLossConfig
Source§impl Config for BinaryCrossEntropyLossConfig
impl Config for BinaryCrossEntropyLossConfig
§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 BinaryCrossEntropyLossConfig
impl Debug for BinaryCrossEntropyLossConfig
Source§impl<'de> Deserialize<'de> for BinaryCrossEntropyLossConfig
impl<'de> Deserialize<'de> for BinaryCrossEntropyLossConfig
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
Auto Trait Implementations§
impl Freeze for BinaryCrossEntropyLossConfig
impl RefUnwindSafe for BinaryCrossEntropyLossConfig
impl Send for BinaryCrossEntropyLossConfig
impl Sync for BinaryCrossEntropyLossConfig
impl Unpin for BinaryCrossEntropyLossConfig
impl UnsafeUnpin for BinaryCrossEntropyLossConfig
impl UnwindSafe for BinaryCrossEntropyLossConfig
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