{ "info": { "author": "Artem Mavrin", "author_email": "artemvmavrin@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 1 - Planning", "Intended Audience :: Developers", "Intended Audience :: Education", "Intended Audience :: Science/Research", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.7", "Topic :: Scientific/Engineering", "Topic :: Scientific/Engineering :: Artificial Intelligence", "Topic :: Scientific/Engineering :: Mathematics", "Topic :: Software Development", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "==========\nFocal Loss\n==========\n\n.. image:: https://img.shields.io/pypi/pyversions/focal-loss\n :target: https://pypi.org/project/focal-loss\n :alt: Python Version\n\n.. image:: https://img.shields.io/pypi/v/focal-loss\n :target: https://pypi.org/project/focal-loss\n :alt: PyPI Package Version\n\n.. image:: https://travis-ci.com/artemmavrin/focal-loss.svg?branch=master\n :target: https://travis-ci.com/artemmavrin/focal-loss\n :alt: Build Status\n\n.. image:: https://codecov.io/gh/artemmavrin/focal-loss/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/artemmavrin/focal-loss\n :alt: Code Coverage\n\n.. image:: https://readthedocs.org/projects/focal-loss/badge/?version=latest\n :target: https://focal-loss.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status\n\n.. image:: https://img.shields.io/github/license/artemmavrin/focal-loss\n :target: https://github.com/artemmavrin/focal-loss/blob/master/LICENSE\n :alt: License\n\nTensorFlow implementation of focal loss [1]_: a loss function generalizing\nbinary cross-entropy loss that penalizes hard-to-classify examples.\n\nThe ``focal_loss`` package provides a function ``binary_focal_loss`` and a class\n``BinaryFocalLoss`` that can be used as stand-in replacements for\n``tf.keras.losses`` functions and classes, respectively.\n\n.. code-block:: python\n\n # Typical tf.keras API usage\n import tensorflow as tf\n from focal_loss import BinaryFocalLoss\n\n model = tf.keras.Model(...)\n model.compile(\n optimizer=...,\n loss=BinaryFocalLoss(gamma=2)\n metrics=...,\n )\n history = model.fit(...)\n\n.. image:: docs/source/images/focal-loss.png\n :alt: Focal loss plot\n\nInstallation\n------------\n\n1. Make sure that a CPU or GPU version of TensorFlow 2.0 or later is installed\n (see `this link `__ for installation\n instructions).\n\n2. The ``focal_loss`` package can be installed using the\n `pip `__ utility. For the latest version,\n install directly from the package's\n `GitHub page `__:\n\n .. code-block:: bash\n\n pip install git+https://github.com/artemmavrin/focal-loss.git\n\n Alternatively, install the a recent release from the\n `Python Package Index (PyPI) `__:\n\n .. code-block:: bash\n\n pip install focal-loss\n\n .. note::\n\n To install the project for development (e.g., to make changes to the\n source code), clone the project repository from GitHub and run\n :code:`make dev`:\n\n .. code-block:: bash\n\n git clone https://github.com/artemmavrin/focal-loss.git\n cd focal-loss\n make dev\n\n This will additionally install the requirements needed\n to run tests, check code coverage, and produce documentation.\n\nReferences\n----------\n\n.. [1] T. Lin, P. Goyal, R. Girshick, K. He and P. Doll\u00e1r. Focal loss for dense\n object detection. IEEE Transactions on Pattern Analysis and Machine\n Intelligence, 2018. (`DOI `__)\n (`arXiv preprint `__)\n\n\n", "description_content_type": "text/x-rst", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/artemmavrin/focal-loss", "keywords": "", "license": "Apache 2.0", "maintainer": "", "maintainer_email": "", "name": "focal-loss", "package_url": "https://pypi.org/project/focal-loss/", "platform": "", "project_url": "https://pypi.org/project/focal-loss/", "project_urls": { "Homepage": "https://github.com/artemmavrin/focal-loss" }, "release_url": "https://pypi.org/project/focal-loss/0.0.1/", "requires_dist": [ "numpy ; extra == 'dev'", "scipy ; extra == 'dev'", "jupyter ; extra == 'dev'", "matplotlib ; extra == 'dev'", "seaborn ; extra == 'dev'", "pytest ; extra == 'dev'", "coverage ; extra == 'dev'", "sphinx ; extra == 'dev'", "sphinx-rtd-theme ; extra == 'dev'" ], "requires_python": "", "summary": "TensorFlow implementation of focal loss.", "version": "0.0.1" }, "last_serial": 5865283, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "7ec31ba04089d5f03f9f3605c39ab7b6", "sha256": "d36749b514290c06cc9b373a2a1835da91fa60dc20943676044f4303ffdda359" }, "downloads": -1, "filename": "focal_loss-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "7ec31ba04089d5f03f9f3605c39ab7b6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 14082, "upload_time": "2019-09-21T06:13:04", "url": "https://files.pythonhosted.org/packages/aa/52/001d60921313c26ffcc75662d776b4b6c3bcd2965066705e9cdd21f69bc8/focal_loss-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "64756d0d3261177c6b725e0f8a085440", "sha256": "27b7a26dc618918e130b5d2d60eac27f0a9c50d58b18ffa03a7e7b0d81d375bb" }, "downloads": -1, "filename": "focal-loss-0.0.1.tar.gz", "has_sig": false, "md5_digest": "64756d0d3261177c6b725e0f8a085440", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11093, "upload_time": "2019-09-21T06:13:06", "url": "https://files.pythonhosted.org/packages/fa/b6/d989de4741f5ec840a0f5104fa42373e8529d5de2b94ccf9715a0c3f94a8/focal-loss-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7ec31ba04089d5f03f9f3605c39ab7b6", "sha256": "d36749b514290c06cc9b373a2a1835da91fa60dc20943676044f4303ffdda359" }, "downloads": -1, "filename": "focal_loss-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "7ec31ba04089d5f03f9f3605c39ab7b6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 14082, "upload_time": "2019-09-21T06:13:04", "url": "https://files.pythonhosted.org/packages/aa/52/001d60921313c26ffcc75662d776b4b6c3bcd2965066705e9cdd21f69bc8/focal_loss-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "64756d0d3261177c6b725e0f8a085440", "sha256": "27b7a26dc618918e130b5d2d60eac27f0a9c50d58b18ffa03a7e7b0d81d375bb" }, "downloads": -1, "filename": "focal-loss-0.0.1.tar.gz", "has_sig": false, "md5_digest": "64756d0d3261177c6b725e0f8a085440", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11093, "upload_time": "2019-09-21T06:13:06", "url": "https://files.pythonhosted.org/packages/fa/b6/d989de4741f5ec840a0f5104fa42373e8529d5de2b94ccf9715a0c3f94a8/focal-loss-0.0.1.tar.gz" } ] }