Skip to main content

HL Gauss - Pytorch

Project description

HL Gauss - Pytorch

The proposed Gaussian Histogram Loss (HL-Gauss) proposed by Imani et al. with a few convenient wrappers, in Pytorch.

A team at Deepmind wrote a paper with a lot of positive findings for its use in value-based RL.

Install

$ pip install hl-gauss-pytorch

Usage

import torch
from hl_gauss_pytorch import HLGaussLoss

hl_gauss = HLGaussLoss(0., 5., 32, sigma = 0.5)

logits = torch.randn(1, 16, 32).requires_grad_()
targets = torch.randint(0, 5, (1, 16)).float()

loss = hl_gauss(logits, targets)
loss.backward()

Citations

@article{Imani2024InvestigatingTH,
    title   = {Investigating the Histogram Loss in Regression},
    author  = {Ehsan Imani and Kai Luedemann and Sam Scholnick-Hughes and Esraa Elelimy and Martha White},
    journal = {ArXiv},
    year    = {2024},
    volume  = {abs/2402.13425},
    url     = {https://api.semanticscholar.org/CorpusID:267770096}
}
@inproceedings{Imani2018ImprovingRP,
    title   = {Improving Regression Performance with Distributional Losses},
    author  = {Ehsan Imani and Martha White},
    booktitle = {International Conference on Machine Learning},
    year    = {2018},
    url     = {https://api.semanticscholar.org/CorpusID:48365278}
}
@article{Farebrother2024StopRT,
    title   = {Stop Regressing: Training Value Functions via Classification for Scalable Deep RL},
    author  = {Jesse Farebrother and Jordi Orbay and Quan Ho Vuong and Adrien Ali Taiga and Yevgen Chebotar and Ted Xiao and Alex Irpan and Sergey Levine and Pablo Samuel Castro and Aleksandra Faust and Aviral Kumar and Rishabh Agarwal},
    journal = {ArXiv},
    year   = {2024},
    volume = {abs/2403.03950},
    url    = {https://api.semanticscholar.org/CorpusID:268253088}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hl_gauss_pytorch-0.0.1.tar.gz (134.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hl_gauss_pytorch-0.0.1-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file hl_gauss_pytorch-0.0.1.tar.gz.

File metadata

  • Download URL: hl_gauss_pytorch-0.0.1.tar.gz
  • Upload date:
  • Size: 134.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for hl_gauss_pytorch-0.0.1.tar.gz
Algorithm Hash digest
SHA256 3ea2622c752180175fb4ff9246b8ddf238a53e83c73e1ed8b3477623dcd64675
MD5 5e682d9c1da098e85c31e94e94a26e45
BLAKE2b-256 cfca07d716234cb32bf11912d4e12458730915868a416755e89ba73185279e75

See more details on using hashes here.

File details

Details for the file hl_gauss_pytorch-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for hl_gauss_pytorch-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b3a20e449e96da61cdbd22beae5ba2f5f3fe5da49e1b15e198710e51fa03015a
MD5 c16e637fda3e8f07a5b1ebe6e6efac58
BLAKE2b-256 101a4a15391bf4b62b43b7dd0e387bcfd4edd645322ac4a5e3c4754496ac421b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page