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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: focal_loss_torch-0.0.9.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6

File hashes

Hashes for focal_loss_torch-0.0.9.tar.gz
Algorithm Hash digest
SHA256 725e62e29bc3e7e95f3e2cc7a8555c95f0c36a8c096f384138a93f1cb2f166bc
MD5 830fb1d2197c457b2119c8226d993051
BLAKE2b-256 f7d04c0eb9d22dd36f3dd97372552d3d6ff1fdc9ae2df6c94199df9d0975b980

See more details on using hashes here.

File details

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

File metadata

  • Download URL: focal_loss_torch-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6

File hashes

Hashes for focal_loss_torch-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 1bd21add10f874202f3e35a5768dc0bc4faf8949d4bad9b61c27227a8fab1502
MD5 7f43ffb83642bd130b395e5ed2e998e6
BLAKE2b-256 b0a4d711c3f9eb92a1ab1fb42508fa03d210667fc16115f3986255f59f7f14c1

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