nn-toolbox icon indicating copy to clipboard operation
nn-toolbox copied to clipboard

may you share full example for PinballLoss with data for multivariate regression

Open Sandy4321 opened this issue 3 years ago • 0 comments

may you share full example for PinballLoss with data for multivariate regression for example data like https://github.com/strongio/quantile-regression-tensorflow/blob/master/mcycle https://github.com/strongio/quantile-regression-tensorflow/blob/master/Quantile%20Loss.ipynb

per

https://github.com/nhatsmrt/nn-toolbox/blob/86bbb8a88f1a873ff7a9f9cd0727c3e514335f66/tests/test_pinball.py

class TestPinball: def test_pinball(self): """ Adopt from https://www.tensorflow.org/addons/api_docs/python/tfa/losses/PinballLoss """ target = torch.from_numpy(np.array([0., 0., 1., 1.])) input = torch.from_numpy(np.array([1., 1., 1., 0.]))

    loss = PinballLoss(tau=0.1)
    assert abs(loss(input, target).item() - 0.475) < 1e-3

Sandy4321 avatar Jan 18 '22 22:01 Sandy4321