Skip to main content

Simple pytorch implementation of focal loss

Project description

focal_loss_torch

Simple pytorch implementation of focal loss introduced by Lin et al [1].

Usage

Install the package using pip

pip install focal_loss_torch

Focal loss is now accessible in your pytorch environment:

from focal_loss.focal_loss import FocalLoss

...
criterion = FocalLoss(alpha=2, gamma=5)
...

Contributions

Contributions, criticism or corrections are always welcome. Just send me a pull request!

References

[1] Lin, T. Y., et al. "Focal loss for dense object detection." arXiv 2017." arXiv preprint arXiv:1708.02002 (2002).

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

focal_loss_torch-0.0.6.tar.gz (2.1 kB view details)

Uploaded Source

Built Distribution

focal_loss_torch-0.0.6-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file focal_loss_torch-0.0.6.tar.gz.

File metadata

  • Download URL: focal_loss_torch-0.0.6.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.6.0.post20201009 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0

File hashes

Hashes for focal_loss_torch-0.0.6.tar.gz
Algorithm Hash digest
SHA256 d87ca1a0a7571509e675b00d14960132f9539ee0a4a05ac970a2490a395c7532
MD5 a576b0cda4c03997ed2a063f52e46f7f
BLAKE2b-256 939075779a2a0739ea1ae95e2f694bf6df81b69e908c6d2999c9447beb2b64cf

See more details on using hashes here.

File details

Details for the file focal_loss_torch-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: focal_loss_torch-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.6.0.post20201009 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0

File hashes

Hashes for focal_loss_torch-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 9ab978e48b6f397e176cca368c2619974da217d060d13ec32f2729d142cf5065
MD5 804e989dcf30f5c3519ea87a1108a401
BLAKE2b-256 a38034d4cefd309aa3ffb64ba72655b5f13f5b94c0edb3eaa5a7dc042dd33e79

See more details on using hashes here.

Supported by

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