TensorLy 笔记系列
1 TensorLy 简介
TensorLy 作为张量操作的 python 的第三方库,支持张量中常见的操作,比如 CP等各种分解。TensorLy 目前的测试都是基于 python3 进行的,因此并不确定是否能很好的适配 python2。个人建议如果需要使用 TensorLy, 请确保使用 python3 作为开发语言。
2. TensorLy 安装
TensorLy 的安装支持三种模式,可以根据个人的喜好进行选择。
2.1 使用 pip 安装
pip install -U tensorly
## 其中 -U 是一个参数,如果后续想升级该库,可以添加该参数
2.2 使用 Conda 安装
conda install -c tensorly tensorly
2.3 源码变异
# 下载源码
git clone https://github.com/tensorly/tensorly
cd tensorly
# 编译源码
pip install -e
3. 测试样例
TensorLy 中提供了很多样例,可以使用 pytest
测试所有的样例
pytest tensorly
4. 编译文档
编译参考文当前需要安装 slimit
和 minify
等两个库。
pip install slimit rcssmin
通过网页阅读相关文档
make html
结果存储在 _build/html
中。