Skip to main content

A Python Library Implementing Dimension Insensitive Euclidean Metric

Project description

plot

License

diemsim

diemsim is an optimized Python library to compute "Dimension Insensitive Euclidean Metric (DIEM)" which surpasses Cosine similarity for multidimensional comparisons. Benchmarking

Latency Benchmarking

DIEM_Stat get_DIEM

Our proposed approaches,
Compact Vectorization optimizes latency of the existing function 'DIEM_Stat' by around 46.50%
Compact Optimized getDIEM optimizes latency of the existing function 'getDIEM' by 34.27%

Getting Started

Install the package via pip:

pip install diemsim

Usage

from diemsim import DIEM

N= 12
maxV= 1
minV= 0
n_iter= int(1e5)

S1= np.random.rand(N, 1) * (maxV - minV) + minV
S2= np.random.rand(N, 1) * (maxV - minV) + minV

# Initialize DIEM
diem= DIEM( N= N, maxV= maxV, minV= minV, n_iter= n_iter ) 

# Compute DIEM value
value= diem.sim( S1, S2)

print( "Output Value: ", value )

Find Quick Start notebook here

Key Contributors

Boddu Sri Pavan , Chandrasheker Thummanagoti

Please refer CONTRIBUTING.md for contributions to diemsim

Acknowledgement

BibTeX

@misc{tessari2025surpassingcosinesimilaritymultidimensional,
title={Surpassing Cosine Similarity for Multidimensional Comparisons: Dimension Insensitive Euclidean Metric},
author={Federico Tessari and Kunpeng Yao and Neville Hogan},
year={2025},
eprint={2407.08623},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2407.08623},
}

To cite our Python library

Our citation

Thank You !

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

diemsim-0.0.1.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

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

diemsim-0.0.1-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file diemsim-0.0.1.tar.gz.

File metadata

  • Download URL: diemsim-0.0.1.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.11.3 Windows/10

File hashes

Hashes for diemsim-0.0.1.tar.gz
Algorithm Hash digest
SHA256 68f74f85af3080a8c5f137aee308fc74bfaf7080baf718d099e3c53a95946f32
MD5 c9a6f7718a2f5dacd7717104bb182336
BLAKE2b-256 22662d9283394c298a2a19a04a921dc25ead4390d0b4ca2969cc2509f35b557b

See more details on using hashes here.

File details

Details for the file diemsim-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: diemsim-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.11.3 Windows/10

File hashes

Hashes for diemsim-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3c2693a828f100d678432866a215feb42fc7132e064bd1bad41e8a71b42ed72f
MD5 9ea8a849f4ef70c6fa70a852d89a5f45
BLAKE2b-256 13a95aefbedfbe4b252eb7cd8b28907656c1bca7a321f17e71c57ce69dd1443e

See more details on using hashes here.

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