Skip to main content

Official Pytorch Library for Tversky Neural Networks

Project description

Official pytorch library for Tversky Neural Networks

Tests Publish to PyPI PyPI - Version

Installation

Note: tversky requires PyTorch ≥ 2.0. Install it first following the instructions at https://pytorch.org/get-started. Then run:

pip install tversky

Notes

  • The code used to reproduce the experiments presented in our ICLR 2026 paper is located in the tversky-networks-iclr2026 repository. This library was forked that repository. That repository does not use this library.

Component: Tversky Similarity Layer

from tversky import nn as tnn

sim_layer = tnn.TverskySimilarity(
    embedding_dim=64,
    fbank_size=128,
    similarity_model='contrast',
    normalize=False
)

Component: Tversky Projection Layer

from tversky import nn as tnn

proj_layer = tnn.TverskyProjection(
    embedding_dim=64,
    class_count=10,
    fbank_size=128,
    similarity_model='contrast',
    normalize=False
)

License

LICENSE.txt

Citation

If you use this work, please cite the following paper:

@inproceedings{doumbouya2026tversky,
    title={Tversky Neural Networks: Psychologically Plausible Deep Learning with Differentiable Tversky Similarity},
    author={Moussa Koulako Bala Doumbouya and Dan Jurafsky and Christopher D Manning},
    booktitle={The Fourteenth International Conference on Learning Representations},
    year={2026},
    url={https://openreview.net/forum?id=koKWoKaMrE}
}

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

tversky-0.1.2.tar.gz (204.3 kB view details)

Uploaded Source

Built Distribution

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

tversky-0.1.2-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file tversky-0.1.2.tar.gz.

File metadata

  • Download URL: tversky-0.1.2.tar.gz
  • Upload date:
  • Size: 204.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tversky-0.1.2.tar.gz
Algorithm Hash digest
SHA256 0adb78f7c96f5bfe3e5ed1ad0623c7b277d5cb0d478b168738d6ff7b6daec3db
MD5 ed316fa9cf3d5f0c51b73ef6681d8d10
BLAKE2b-256 e0cdc1263d9b7e1f72daddf277e59a1b9c3f81d8a9edf57cc2c259993fd8ea96

See more details on using hashes here.

Provenance

The following attestation bundles were made for tversky-0.1.2.tar.gz:

Publisher: pypi.yml on mdoumbouya/tversky

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tversky-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: tversky-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tversky-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6fcd3fa091ea9e2524ecba624685f79beaf8e6bea18cf58fd1eec7a4ab5d7488
MD5 bc251a69c1dfcb99b3f3878e81c5b9fb
BLAKE2b-256 781d41d5e05d437092821944ab72f323b99d78a11dcc3478ce3154d792213ef5

See more details on using hashes here.

Provenance

The following attestation bundles were made for tversky-0.1.2-py3-none-any.whl:

Publisher: pypi.yml on mdoumbouya/tversky

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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