tnbar / tednet

TedNet: A Pytorch Toolkit for Tensor Decomposition Networks
MIT License
91 stars 12 forks source link

Is there any implementation about decompose a specific tensor into TT format directly? #2

Closed LouiValley closed 2 years ago

LouiValley commented 2 years ago

Hi, it is a good work that summarizes many decomposition methods including tensor train. I just read the whole code and API document, but I don't find any implementation about decomposing a specific value tensor into TT format directly. I guess currently, the implementation is to set the data format into TT/CP/ or other formats from the beginning and re-train the network from the scratch. Or do I miss some details?

iyupan commented 2 years ago

Hello, thanks for your interest in our work. In current v0.1.3, we haven't added tensor decomposition methods (e.g., Tensor Train (TT)) in tednet, since Tensor Decomposition Networks (TDNs) are directly built with tensor formats[1][2] and trained from the scratch. We are going to add tensor decomposition as an initialization method for TDNs in the future, which may take some time. If you need TT to initialize TDNs, it can be implemented by redefining the function reset_parameters.

[1] Y. Yang, D. Krompass, and V. Tresp, “Tensor-train recurrent neural networks for video classification,” in ICML, ser. Proceedings of Machine Learning Research, vol. 70. PMLR, 2017, pp. 3891–3900. [2] Y. Pan, J. Xu, M. Wang, J. Ye, F. Wang, K. Bai, and Z. Xu, “Compressing recurrent neural networks with tensor ring for action recognition,” in AAAI. AAAI Press, 2019, pp. 4683–4690.

LouiValley commented 2 years ago

Thanks for your reply, let me understand your answer again. There are two ways:

  1. Before training, we set the initial layer as a TT format layer and then train it from scratch.
  2. Toward the pre-trained model, decompose some layers of data into TT layer format ( which means decomposing specific values into TT format).

Current version v0.1.3: have achieved Method 1, but haven't added method 2. Or neither method 1 nor method 2 are implemented?

iyupan commented 2 years ago

For version v0.1.3, we have achieved Method 1, but haven't added method 2.

LouiValley commented 2 years ago

Thanks for your kind answers.