[BUG]: missing multiplication in `_modifiedHuberLoss` implementation in `ml/incr/binary-classification`
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 72/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Tranquilla
- Stack tecnologico
- javascript
- Ambito
- machine-learning
Direzione di ricerca
Leggi lib/node_modules/@stdlib/ml/incr/binary-classification/lib/model.js, iniziando da Model.prototype._modifiedHuberLoss, e confronta il ramo else con il gradiente previsto e le implementazioni citate. Il lavoro è completato quando l’implementazione applica in modo coerente il fattore 2 proposto con la derivata indicata e preserva il comportamento esistente dell’altro ramo.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
I was going through the wikipedia pages as well as other library implementations of loss functions to implement standalone loss functions and their gradients under ml/base/loss/float64/*.
I noticed a possible bug in _modifiedHuberLoss function implemented under ml/incr/binary-classification
Current implementation:
setReadOnly( Model.prototype, '_modifiedHuberLoss', function modifiedHuber( x, y ) {
var eta;
var d;
eta = this[ this._learningRateMethod ]();
this._regularize( eta );
d = y * this._dot( x.data, x.strides[ 0 ], x.offset );
if ( d < -1.0 ) {
this._add( x, 4.0*eta*y );
} else {
this._add( x, eta*( y-(d*y) ) );
}
return this;
});
I believe in the else branch, it should be this._add( x, eta*2*( y-(d*y) ) ) instead of this._add( x, eta*( y-(d*y) ) ). That is, it seems like it is missing a multiplication with 2 here.
cc: @Planeshifter
Related Issues
No response
Questions
No.
Demo
No response
Reproduction
- a
- b
- c
Expected Results
\frac{\partial \ell}{\partial p} =
\begin{cases}
-4y & \text{if } yp < -1 \\
-2y(1 - yp) & \text{if } -1 \le yp \le 1 \\
0 & \text{if } yp > 1
\end{cases}
Actual Results
Version
No response
Environments
N/A
Browser Version
No response
Node.js / npm Version
No response
Platform
No response
Checklist
- Read and understood the Code of Conduct.
- Searched for existing issues and pull requests.
- Lingua principale
- JavaScript
- Stelle
- 6k
- Fork
- 1.3k
- Merge medio
- 1g 1h
- PR unite (30g)
- 559
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di stdlib-js/stdlib
-
Fix JavaScript lint errors ApertaGood First Issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
-
Fix JavaScript lint errors ApertaGood First Issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Fix JavaScript lint errors ApertaGood First Issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
-
Fix JavaScript lint errors ApertaGood First Issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
Tutte le issue di stdlib-js/stdlib
Issue simili
-
curation good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
amponce/archive-movie-browser#186 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
clerk/javascript#9852 ·
-
bug p1 tools
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
HarperFast/skills#96 ·
-
factory-active factory-automatic task-bug-reproduction-cannot-reproduce task-identify-harness-labels-done task-identify-issue-type-done
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100