{"id":15684504,"url":"https://github.com/cyrusvahidi/vector-quantized-timbre","last_synced_at":"2025-05-07T16:10:56.608Z","repository":{"id":61003894,"uuid":"417104303","full_name":"cyrusvahidi/vector-quantized-timbre","owner":"cyrusvahidi","description":"Implementation/Interpretation of Vector Quantized Timbre Representation (Bitton et al 2020)","archived":false,"fork":false,"pushed_at":"2022-01-28T14:24:43.000Z","size":6536,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-26T02:36:16.216Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","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/cyrusvahidi.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":"2021-10-14T11:31:34.000Z","updated_at":"2024-02-20T22:56:24.000Z","dependencies_parsed_at":"2022-10-08T06:41:14.256Z","dependency_job_id":null,"html_url":"https://github.com/cyrusvahidi/vector-quantized-timbre","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/cyrusvahidi%2Fvector-quantized-timbre","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyrusvahidi%2Fvector-quantized-timbre/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyrusvahidi%2Fvector-quantized-timbre/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyrusvahidi%2Fvector-quantized-timbre/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cyrusvahidi","download_url":"https://codeload.github.com/cyrusvahidi/vector-quantized-timbre/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242991280,"owners_count":20218141,"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":[],"created_at":"2024-10-03T17:18:12.736Z","updated_at":"2025-03-11T07:31:46.666Z","avatar_url":"https://github.com/cyrusvahidi.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vector-Quantized Timbre Representation (Bitton et al. 2020)\nImplementation/exploration of the paper [Vector-Quantized Timbre Representation](https://arxiv.org/pdf/2007.06349.pdf)\n\nDeveloped with [Adán Benito](https://github.com/adanlbenito) early in 2021\n\n* This repository contains a Pytorch Lightning framework to train a model similar to the one described in the paper. \n* The main difference is the use of an exponential moving-average (EMA) codebook\n* A conventional VQ codebook caused the codebook to collapse `perplexity = 1`.\n\n## Setup\n```\npip install -r requirements.txt\npip install -e .\n```\n\n## Data preparation\nData splits and preprocessing are performed for the URMP western musical instrument dataset\nTo split the URMP dataset into 3 second numpy files for efficient loading:\n`python scripts/urmp_numpy_segments.py \u003cpath_to_URMP\u003e \u003cnumpy_out_dir\u003e`\n\nThen, set the `URMP_DATA_DIR` variable in `gin_configs/vq_timbre.gin` to `\u003cnumpy_out_dir\u003e`\n\n## Training\n\n`python scripts/run_train.py`\n\n* Most hyperparameters are configured with `gin-config`\n* set `URMP.instr_ids= [\u003cinstrument_id\u003e]` to train for a target musical instrument\n* To log to wandb, enable `lightning_run.logger = True` in `gin_configs/vq_timbre.gin`\n\n## Evaluation\n* download model checkpoint for a model trained on Violin: `https://drive.google.com/file/d/1fJ9bkM5eAuCNz4DClfeTm6b-IKjkTs0y/view?usp=sharing`  \n* put it in `/checkpoints`\n* `jupyter notebook`\n* see `notebooks/eval_model.ipynb` for simple timbre transfer and feature-based synthesis\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyrusvahidi%2Fvector-quantized-timbre","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcyrusvahidi%2Fvector-quantized-timbre","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyrusvahidi%2Fvector-quantized-timbre/lists"}