Giter VIP home page Giter VIP logo

mtt's Introduction

Last update: 08/09/2014

MTT

Matlab Tensor Tools is an easy-to-use library to work with tensors.

See also:

Presentation about Matrix and Tensor Tools for Computer Vision 
http://www.slideshare.net/andrewssobral/matrix-and-tensor-tools-for-computer-vision

LRSLibrary: Low-Rank and Sparse Tools for Background Modeling and Subtraction in Videos
https://github.com/andrewssobral/lrslibrary

IMTSL: Incremental and Multi-feature Tensor Subspace Learning
https://github.com/andrewssobral/imtsl

Citation

If you use this code for your publications, please cite it as:

@misc{asobral2014,
    author       = "Sobral, Andrews",
    title        = "Matlab Tensor Tools",
    year         = "2014",
    url          = "https://github.com/andrewssobral/mtt/"
}

Demos

tensor_demo_operations.m - Basic operations
tensor_demo_hosvd_ihosvd.m - High-order singular value decomposition (Tucker decomposition)
tensor_demo_parafac_als.m - CP decomposition via ALS (Alternating Least-Squares)
tensor_demo_tucker_als.m - Tucker decomposition via ALS (Alternating Least-Squares)
tensor_demo_tsvd.m - t-SVD and inverse t-svd
tensor_demo_ntf.m - Non-Negative Tensor Factorization
tensor_demo_subtensors_ntf_hals.m - Low-rank approximation based Non-Negative Tensor(CP) factorization
tensor_demo_inclearn.m - Incremental tensor learning

Example of tensor operations

A = reshape(1:12,[2,2,3]);
B = reshape(1:12,[2,2,3]);

%% Basic operations
[A1,A2,A3] = tensor_matricization(A);

M22 = reshape(1:4,[2,2]);
M33 = reshape(1:9,[3,3]);
B1 = tensor_nmodeproduct(A,M22,1);
B2 = tensor_nmodeproduct(A,M22,2);
B3 = tensor_nmodeproduct(A,M33,3);

Au = tensor_unfold(A);
A_hat = tensor_fold(Au,size(A));

[A1_] = tensor_slices_frontal(A);
[A2_] = tensor_slices_lateral(A);
[A3_] = tensor_slices_horizontal(A);

[At1_] = tensor_fibers_column(A);
[At2_] = tensor_fibers_row(A);
[At3_] = tensor_fibers_tube(A);

Bt = tensor_transpose(B);
[C] = tensor_product(A,B);

%% HoSVD and iHoSVD decomposition
T = tensor(A);
[core,U] = tensor_hosvd(T);
[T_hat] = tensor_ihosvd(core,U);

%% t-SVD decomposition
[U,S,V] = tensor_t_svd(A);
[C] = tensor_product(U,S);
[A_hat] = tensor_product(C,tensor_transpose(V));

%% Tucker ALS decomposition
r = 10;
T_hat = tucker_als(T,[r r r]);

%% PARAFAC/CP ALS decomposition
T_hat = cp_als(T, r);

mtt's People

Contributors

andrewssobral avatar

Stargazers

Timothy avatar

Watchers

James Cloos avatar

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.