Cost Functions

0%

    Regression Losses

    • Vectorized Huber Loss and Gradient

      Junior
    • Batch MSE and MAE with Gradients

      Junior
    • Best Constant Prediction Under Regression Losses

      Junior
    • Vectorized Quantile Pinball Loss

      Mid
    • Numerically Stable Log-Cosh Loss and Gradient

      Mid

    Classification Losses

    • Margin-Based Classification Surrogate Losses

      Junior
    • Multiclass SVM Hinge Loss and Subgradient

      Mid
    • Cost-Sensitive Binary Cross-Entropy from Logits

      Mid
    • Weighted Multi-Label BCE From Logits

      Mid
    • Label-Smoothed Cross-Entropy with Ignore Index

      Mid
    • MSE-on-Sigmoid vs BCE Logit Gradients

      Mid
    • Focal Loss From Logits With Gradients

      Senior

    Metric Learning Contrastive Losses

    • Contrastive Loss for Siamese Pairs

      Junior
    • Cosine Embedding Loss With Safe Norms

      Junior
    • NT-Xent Contrastive Loss and Gradient

      Senior
    • Triplet Loss with Semi-Hard Negative Mining

      Senior

    Probabilistic Likelihood Losses

    • KL Divergence Loss with Zero-Probability Targets

      Mid
    • Poisson NLL Loss From Log-Rates

      Mid
    • Heteroscedastic Gaussian NLL with Clamped Log-Variance

      Mid
    • Tweedie Deviance Loss With Log-Link Gradient

      Senior

    Specialized Composite Losses

    • Pairwise Margin Ranking Loss

      Junior
    • Weighted Loss Wrapper with Reduction Modes

      Junior
    • Knowledge Distillation Loss and Gradient

      Mid
    • Vectorized RankNet Loss and Gradient

      Mid
    • Soft Dice and BCE Hybrid Segmentation Loss

      Mid
    • Uncertainty-Weighted Multi-Task Loss

      Senior
    • Guarded BCE Loss with Clipping and NaN Detection

      Senior
    • DPO Loss and Gradient in NumPy

      Senior
    • Asymmetric Pseudo-Huber Boosting Objective

      Senior
    • ListNet Top-One Loss with Padding Masks

      Senior