Skip to main content

Matrix transformator in Python

Project description

matrixor

GitHub release PyPI release Build MIT License

Matrix transformations in Python. Implements algorithm 2.4 (AO+Scaling) of the paper:

@article{devetal2018,
    title={{Absolute Orientation for Word Embedding Alignment}},
    author={Sunipa Dev and Safia Hassan and Jeff M. Phillips},
    journal={CoRR},
    year={2018},
    volume={abs/1806.01330}
}

Install

pip install matrixor

or, after a git clone:

python3 setup.py install

Run

Align two models with Absolute Orientation + Scaling and return RMSE

To align two embeddings, run:

matrixor align \
  --matrix-1 /abs/path/to/xxx.vec.npy  \
  --matrix-2 /abs/path/to/yyy.vec.npy \

pass in the --average to return the averaged RMSE by aligning A and B then B and A (alignment may not be symmetric due to floating point average)

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

matrixor-1.0.7.tar.gz (3.4 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page