{"id":15629721,"url":"https://github.com/jacobgil/pytorch-tensor-decompositions","last_synced_at":"2025-04-09T09:07:35.795Z","repository":{"id":37412443,"uuid":"118661743","full_name":"jacobgil/pytorch-tensor-decompositions","owner":"jacobgil","description":"PyTorch implementation of [1412.6553] and [1511.06530] tensor decomposition methods for convolutional layers. ","archived":false,"fork":false,"pushed_at":"2021-12-01T15:50:08.000Z","size":14,"stargazers_count":282,"open_issues_count":7,"forks_count":63,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-02T06:09:03.191Z","etag":null,"topics":["deep-learning","pytorch","tensorly"],"latest_commit_sha":null,"homepage":"https://jacobgil.github.io/deeplearning/tensor-decompositions-deep-learning","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jacobgil.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-23T19:55:48.000Z","updated_at":"2025-03-22T21:54:57.000Z","dependencies_parsed_at":"2022-08-18T20:21:14.041Z","dependency_job_id":null,"html_url":"https://github.com/jacobgil/pytorch-tensor-decompositions","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobgil%2Fpytorch-tensor-decompositions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobgil%2Fpytorch-tensor-decompositions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobgil%2Fpytorch-tensor-decompositions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobgil%2Fpytorch-tensor-decompositions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jacobgil","download_url":"https://codeload.github.com/jacobgil/pytorch-tensor-decompositions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248008630,"owners_count":21032556,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-learning","pytorch","tensorly"],"created_at":"2024-10-03T10:28:20.033Z","updated_at":"2025-04-09T09:07:35.770Z","avatar_url":"https://github.com/jacobgil.png","language":"Python","funding_links":[],"categories":["PROJECTS"],"sub_categories":["2023"],"readme":"# PyTorch Tensor Decompositions\n\nThis is an implementation of Tucker and CP decomposition of convolutional layers.\nA blog post about this can be found [here](https://jacobgil.github.io/deeplearning/tensor-decompositions-deep-learning).\n\nIt depends on [TensorLy](https://github.com/tensorly/tensorly) for performing tensor decompositions.\n\n# Usage\n\n- Train a model based on fine tuning VGG16: ``python main.py --train``.\n- There should be a dataset with two categories. One directory for each category. Training data should go into a directory called 'train'.  Testing data should go into a directory called 'test'. This can be controlled with the flags --train_path and --test_path.\n- I used the [Kaggle Cats/Dogs dataset.](https://www.kaggle.com/c/dogs-vs-cats)\n- The model is then saved into a file called \"model\".\n\n- Perform a decomposition: \n``python main.py --decompose``\nThis saves the new model into \"decomposed_model\".\nIt uses the Tucker decomposition by default. To use CP decomposition, pass --cp.\n\n- Fine tune the decomposed model: ``python main.py --fine_tune``\n\n# References\n\n- CP Decomposition for convolutional layers is described here: https://arxiv.org/abs/1412.6553\n- Tucker Decomposition for convolutional layers is described here: https://arxiv.org/abs/1511.06530\n- VBMF for rank selection is described here: http://www.jmlr.org/papers/volume14/nakajima13a/nakajima13a.pdf\n- VBMF code was taken from here: https://github.com/CasvandenBogaard/VBMF\n- Tensorly: https://github.com/tensorly/tensorly\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacobgil%2Fpytorch-tensor-decompositions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjacobgil%2Fpytorch-tensor-decompositions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacobgil%2Fpytorch-tensor-decompositions/lists"}