Skip to main content

EDRep

Dall'Amico, Belliardo - Learning distributed representations with efficient SoftMax normalization

| Documentation | Paper |

pip install EDRep

This is the Python implementation of the work presented in (Dall'Amico, Belliardo - Learning distributed representations with efficient SoftMax normalization). We propose a 2Vec-like algorithm, formulated for as a general purpose embedding problem. We consider a set of $n$ objects for which we want to obtain a distributed representation $X \in \mathbb{R}^{n\times d}$ in a $d$-dimensional Euclidean space. The algorithm requires a probability matrix $P \in \mathbb{R}^{n\times n}$ as input whose entries $P_{ij}$ are a measure of affinity between the objects $i$ and $j$. We then train the embedding vectors to approximate the input distribution described by the matrix $P$ with a variational approach based on the use of the softmax function of $XX^T$ to learn the embedding, in the spirit of 2Vec algorithms.

In (Dall'Amico, Belliardo - Learning distributed representations with efficient SoftMax normalization) we described an efficient way to estimate in $\mathcal{O}(n)$ operations the normalization constants of ${\rm SoftMax}(XX^T)$ and hence to optimize the efficiently the proposed loss function.

In our implementation, we also consider the case in which $P$ is a rectangular matrix $P\in \mathbb{R}^{n\times m}$ and two embedding matrices need to be learned: $X \in \mathbb{R}^{n\times d}, Y \in \mathbb{R}^{m\times d}$. We refer the reader to the paper and to the documentation for further details on this use case.

We refer the user to the paper and to the documentation for further details.

Requirements

We also shared an Anaconda environment in which all codes were run and tested. You can create it by running the following commands in the terminal

conda env create -f EDRep_env.yml
conda activate EDRep

Citation

If you make use of these codes, please use the following citation:

@article{
dall'amico2025learning,
title={Learning distributed representations with efficient SoftMax normalization},
author={Lorenzo Dall'Amico and Enrico Maria Belliardo},
journal={Transactions on Machine Learning Research},
issn={2835-8856},
year={2025},
url={https://openreview.net/forum?id=9M4NKMZOPu},
note={}
}

Authors

License

This software is released under the GNU AFFERO GENERAL PUBLIC LICENSE (see included file LICENSE)

Metadata

Release files for EDRep 0.1.3

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

Source distribution (sdist)

Source distribution for EDRep 0.1.3
File Size Uploaded Provenance Actions
edrep-0.1.3.tar.gz 43.7 kB Without provenance Details for edrep-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for EDRep 0.1.3
File Interpreter ABI Platform Actions
edrep-0.1.3-py3-none-any.whl Python 3 none any Details for edrep-0.1.3-py3-none-any.whl

Total release size: 74.1 kB

Release files / edrep-0.1.3.tar.gz

Download URL edrep-0.1.3.tar.gz
Size 43.7 kB
Tags Source
SHA-256 checksum
How to use checksums
cda673dbbb05ae883edd4d77bf14d4bf393e2eea9d4e7535a62684f8bcdc9d55
BLAKE2b-256 checksum
How to use checksums
69ab795403cf7d33ef82187264fca4257116c6121b201ad8f9859a13df5932fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.11

Release files / edrep-0.1.3-py3-none-any.whl

Download URL edrep-0.1.3-py3-none-any.whl
Size 30.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8d5c34f14aa6af9c4949323cdfc9f22a5d07a66107f7f06b4acd8ead79ef104a
BLAKE2b-256 checksum
How to use checksums
b1acd1e1107f308677ba8713c66849eafe843e9175bebfeaac849388946c445c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.11

Security for EDRep 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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