pub struct SoftmaxLoss {
pub n_classes: usize,
}Expand description
Softmax (multi-class cross-entropy) loss.
n_classes controls the number of tree committees. Each committee uses
logistic-style gradients on one-hot encoded targets.
Fields§
§n_classes: usizeNumber of classes in the classification problem.
Trait Implementations§
Source§impl Clone for SoftmaxLoss
impl Clone for SoftmaxLoss
Source§fn clone(&self) -> SoftmaxLoss
fn clone(&self) -> SoftmaxLoss
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SoftmaxLoss
impl Debug for SoftmaxLoss
Source§impl Loss for SoftmaxLoss
impl Loss for SoftmaxLoss
Source§fn n_outputs(&self) -> usize
fn n_outputs(&self) -> usize
Number of output dimensions (1 for regression/binary, C for multiclass).
Source§fn gradient(&self, target: f64, prediction: f64) -> f64
fn gradient(&self, target: f64, prediction: f64) -> f64
First derivative of the loss with respect to prediction: dL/df.
Source§fn hessian(&self, _target: f64, prediction: f64) -> f64
fn hessian(&self, _target: f64, prediction: f64) -> f64
Second derivative of the loss with respect to prediction: d^2L/df^2.
Source§fn predict_transform(&self, raw: f64) -> f64
fn predict_transform(&self, raw: f64) -> f64
Transform raw model output to final prediction (identity for regression, sigmoid for binary).
Source§fn initial_prediction(&self, _targets: &[f64]) -> f64
fn initial_prediction(&self, _targets: &[f64]) -> f64
Initial constant prediction (before any trees). Typically the optimal constant
that minimizes sum of losses over the given targets.
impl Copy for SoftmaxLoss
Auto Trait Implementations§
impl Freeze for SoftmaxLoss
impl RefUnwindSafe for SoftmaxLoss
impl Send for SoftmaxLoss
impl Sync for SoftmaxLoss
impl Unpin for SoftmaxLoss
impl UnsafeUnpin for SoftmaxLoss
impl UnwindSafe for SoftmaxLoss
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