Skip to content

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

Description

@Sandy4321

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions