Coder Social home page Coder Social logo

pycp_als's Introduction

pyCP_ALS


pyCP_ALS is the Python implementation of CP-ALS algorithm that was originally introduced in the MATLAB Tensor Toolbox [1,2].

Installation

Option 1: Install using pip

pip install git+https://github.com/MaksimEkin/pyCP_ALS.git

Option 2: Install from source

git clone https://github.com/MaksimEkin/pyCP_ALS.git
cd pyCP_ALS
conda create --name pyCP_ALS python=3.8.5
source activate pyCP_ALS
python setup.py install

Example Usage

from pyCP_ALS import CP_ALS
import pickle

data = pickle.load(open("data/toy_tensor.p", "rb"))
nnz_values = data["nnz_values"]
nnz_coords = data["nnz_coords"]

model = CP_ALS(
    tol=1e-4, 
    n_iters=50, 
    verbose=True, 
    fixsigns=True, 
    random_state=42,
)

M = model.fit(
    coords=nnz_coords, 
    values=nnz_values, 
    rank=2, 
    Minit="random",
)

See the examples for more.

How to Cite pyCP_ALS?

If you use pyCP_ALS, please cite it.

@MISC{Eren2022pyCP_ALS,
  author = {M. E. {Eren}},
  title = {{pyCP_ALS}},
  year = {2022},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/MaksimEkin/pyCP_ALS}}
}

Acknowledgments

This work was done as part of Maksim E. Eren's Master's Thesis at the University of Maryland, Baltimore County with the thesis committee members and collaborators Charles Nicholas, Edward Raff, Roberto Yus, Boian S. Alexandrov, and Juston S. Moore. pyCP_ALS was written as part of the RFoT methodology.

Developer Test Suite

Developer test suites are located under tests/ directory. Tests can be ran from this folder using python -m unittest *.

References

[1] General software, latest release: Brett W. Bader, Tamara G. Kolda and others, Tensor Toolbox for MATLAB, Version 3.2.1, www.tensortoolbox.org, April 5, 2021.

[2] Sparse, Kruskal, and Tucker tensors: B. W. Bader and T. G. Kolda, Efficient MATLAB Computations with Sparse and Factored Tensors, SIAM J. Scientific Computing, 30(1):205-231, 2007, http://dx.doi.org/10.1137/060676489.

pycp_als's People

Contributors

maksimekin avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

umbc-dream-lab

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.