novak-99 / MLPP

A library created to revitalize C++ as a machine learning front end. Per aspera ad astra.
MIT License
1.08k stars 155 forks source link

Possible mistakes in cost functions #12

Closed marchcat69 closed 1 year ago

marchcat69 commented 1 year ago

Cost::MAEDeriv is wrong. y_hat must be compared with y, but not with zero. Cost::WassersteinLoss is same as Cost::HingeLoss, but thats are not same.

novak-99 commented 1 year ago

Hi,

Thank you for taking the time to find these issues. I have updated the MAEDeriv function and the changes will be visible in the next release of ML++.

Regarding the Wasserstein Loss, as I understand it, it is expressed as:

-1/n y_i y_hat_i, summed over n.

and is expressed in the codebase as such.

Please reply back if you found that I misunderstood what you meant to bring up or that I was inaccurate.

Thanks.

marchcat69 commented 1 year ago

About Wassersein Loss - this is my mistake. I thought that I was looking at the code of one function, but in fact, I was looking at the code of another. Your Wasserstein cost function is true. Sorry.

novak-99 commented 1 year ago

Ah, I see- thanks.