Skip to content

Fix elementwise hinge loss and test values and gradients Resolves #100 - #101

Merged
rushter merged 1 commit into
rushter:masterfrom
MdMahadi-hasan:codex/fix-hinge-loss
Nov 16, 2026
Merged

rushter merged 1 commit into
rushter:masterfrom
MdMahadi-hasan:codex/fix-hinge-loss

Conversation

@rushter

@rushter rushter commented Nov 16, 2026

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI balanced review requested due to automatic review settings November 16, 2026 08:51
@rushter rushter changed the title Fix elementwise hinge loss and test values and gradients Fix elementwise hinge loss and test values and gradients Resolves #100 Nov 16, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block the hinge-loss fix and its accompanying regression tests.

No open issues 🎉

What changed in this PR

Fixes hinge loss in the metrics module by clipping each margin at zero before averaging, addressing #100.

Changes:

  • Replaces np.max with elementwise np.maximum.
  • Adds loss-value tests for satisfied, violated, and mixed margins, plus an automatic-differentiation gradient test.
File Description
mla/​metrics/​tests/​test_metrics.py Adds hinge-loss value and gradient regression tests.
mla/​metrics/​metrics.py Corrects elementwise hinge-loss calculation.

Review effort: Balanced

@rushter
rushter merged commit ebe4c14 into rushter:master Nov 16, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants