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.2.tar.gz (2.1 kB view details)

Uploaded Source

Built Distribution

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

focal_loss_torch-0.0.2-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: focal_loss_torch-0.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 caeba5ece685dc77ebc24e3fee9c8185b5cc6d4971720f158f95fb35ae3d04d9
MD5 2f38eacaa27d0ee1f6920fb03d950da9
BLAKE2b-256 e9fd45808e1f3231e7918f73debe8a2f004076a9085324436d46783afa659a93

See more details on using hashes here.

File details

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

File metadata

  • Download URL: focal_loss_torch-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.1 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f6049531811344dc5668ad506d54a5ef5e8681fb0ae11a721ec758e22dc33ec1
MD5 64b4e9e7d3478b0f9314c696e512b118
BLAKE2b-256 579d8b7e6ce182f0384e8a3cd604a347935951b611cc36e5e312ce79d89cc605

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