Skip to main content

Bridging the Gap: Unifying the Training and Evaluation of Neural Network Binary Classifiers

A PyTorch implementation of Bridging the Gap (BtG) losses including F-beta (F1), Accuracy, and AUROC.

Project Webpage: btg.yale.edu

PDF Paper

Citation:

@inproceedings{tsoi2022bridging,
  title         = {Bridging the Gap: Unifying the Training and Evaluation of Neural Network Binary Classifiers},
  author        = {Tsoi, Nathan and Candon, Kate and Li, Deyuan and Milkessa, Yofti and V{\'a}zquez, Marynel},
  booktitle     = {Advances in Neural Information Processing Systems},
  year          = {2022}
}

Usage

Install the torch-btg package:

pip install torch-btg

Use the desired loss in your code, for example,

  • F1-loss:
from torch_btg.loss import f1_loss
...
criterion = fb_loss(beta=1.0)
...
  • Accuracy loss:
from torch_btg.loss import accuracy_loss
...
criterion = accuracy_loss()
...

Development

Setup

python -m pip install --user tox

Then run tests with:

tox

Release files for torch-btg 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for torch-btg 0.0.1
File Size Uploaded
torch_btg-0.0.1.tar.gz 4.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for torch-btg 0.0.1
File Interpreter ABI Platform
torch_btg-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 10.9 kB

Release files / torch_btg-0.0.1.tar.gz

Download URL torch_btg-0.0.1.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
63896f785664c93f771dcd249e45727cf99f0662cd5dc8b59bd4c0edd597aff7
BLAKE2b-256 checksum
How to use checksums
2c773fedc254a39c95369d62e856c40428bfbfc5033d33dc3f8982c1208ffe56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.10

Release files / torch_btg-0.0.1-py3-none-any.whl

Download URL torch_btg-0.0.1-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bbc925e8c43a98478731f53dcc90e488a1c4e312e00cfca9f1deff8a0fef335a
BLAKE2b-256 checksum
How to use checksums
1c12c74df393b3c9a9fef771f81b8a878687761e7bad85576188765725c4ab83
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page