https://github.com/tensorly/tensorly
Revision 218bcac112f1535f5d0843187916fb4977be88f5 authored by Aaron Meurer on 11 December 2018, 21:34:11 UTC, committed by Aaron Meurer on 11 December 2018, 21:34:11 UTC
The idea to modify the tensor with the masked array is from Tomasi, Giorgio, and Rasmus Bro. "PARAFAC and missing values." Chemometrics and Intelligent Laboratory Systems 75.2 (2005): 163-180. This still needs to be modified to continue to work with sparse arrays. Right now, it fully decomposes the factors to compute the modification, which will not work if the fully decomposed factors do not fit in memory.
1 parent 367f376
Tip revision: 218bcac112f1535f5d0843187916fb4977be88f5 authored by Aaron Meurer on 11 December 2018, 21:34:11 UTC
Start adding support for masked values to parafac()
Start adding support for masked values to parafac()
Tip revision: 218bcac
setup.py
try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup, find_packages
import re
from pathlib import Path
def version(root_path):
"""Returns the version taken from __init__.py
Parameters
----------
root_path : pathlib.Path
path to the root of the package
Reference
---------
https://packaging.python.org/guides/single-sourcing-package-version/
"""
version_path = root_path.joinpath('tensorly', '__init__.py')
with version_path.open() as f:
version_file = f.read()
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
version_file, re.M)
if version_match:
return version_match.group(1)
raise RuntimeError("Unable to find version string.")
def readme(root_path):
"""Returns the text content of the README.rst of the package
Parameters
----------
root_path : pathlib.Path
path to the root of the package
"""
with root_path.joinpath('README.rst').open() as f:
return f.read()
root_path = Path(__file__).parent
README = readme(root_path)
VERSION = version(root_path)
config = {
'name': 'tensorly',
'packages': find_packages(exclude=['doc']),
'description': 'Tensor learning in Python.',
'long_description': README,
'long_description_content_type' : 'text/x-rst',
'author': 'Jean Kossaifi',
'author_email': 'jean.kossaifi@gmail.com',
'version': VERSION,
'url': 'https://github.com/tensorly/tensorly',
'download_url': 'https://github.com/tensorly/tensorly/tarball/' + VERSION,
'install_requires': ['numpy', 'scipy', 'nose'],
'license': 'Modified BSD',
'scripts': [],
'classifiers': [
'Topic :: Scientific/Engineering',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 3'
],
}
setup(**config)
Computing file changes ...