{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/abstracted-shapes-as-tokens-a-generalizable","title":"Abstracted Shapes as Tokens -- A Generalizable and Interpretable Model for Time-series Classification","arxiv_id":"2411.01006","date":"2024-11-01","proceeding":null,"authors":["Yunshi Wen","Tengfei Ma","Tsui-Wei Weng","Lam M. Nguyen","Anak Agung Julius"],"abstract":"In time-series analysis, many recent works seek to provide a unified view and representation for time-series across multiple domains, leading to the development of foundation models for time-series data. Despite diverse modeling techniques, existing models are black boxes and fail to provide insights and explanations about their representations. In this paper, we present VQShape, a pre-trained, generalizable, and interpretable model for time-series representation learning and classification. By introducing a novel representation for time-series data, we forge a connection between the latent space of VQShape and shape-level features. Using vector quantization, we show that time-series from different domains can be described using a unified set of low-dimensional codes, where each code can be represented as an abstracted shape in the time domain. On classification tasks, we show that the representations of VQShape can be utilized to build interpretable classifiers, achieving comparable performance to specialist models. Additionally, in zero-shot learning, VQShape and its codebook can generalize to previously unseen datasets and domains that are not included in the pre-training process. The code and pre-trained weights are available at https://github.com/YunshiWen/VQShape.","url_abs":"https://arxiv.org/abs/2411.01006v3","url_pdf":"https://arxiv.org/pdf/2411.01006v3.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"abstracted-shapes-as-tokens-a-generalizable","repo_url":"https://github.com/yunshiwen/vqshape","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"quantization","task_name":"Quantization"},{"task_slug":"representation-learning","task_name":"Representation Learning"},{"task_slug":"time-series-1","task_name":"Time Series"},{"task_slug":"time-series","task_name":"Time Series Analysis"},{"task_slug":"time-series-classification","task_name":"Time Series Classification"},{"task_slug":"zero-shot-learning","task_name":"Zero-Shot Learning"}],"methods":[{"method_slug":"set","method_name":"SET"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2411.01006","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2411.01006"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/yunshiwen/vqshape","reach":null}],"summary":{"ran_draft_wrong":3,"ran":8,"ran_fixture":1,"unverified":6},"by_repo_kind":{"official":{"samples":18,"ran":12,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"0462bc29ff41ba2c","entry":"onehot_straight_through","repo":"yunshiwen/vqshape","repo_kind":"official","path":"vqshape/model.py","file_url":"https://github.com/yunshiwen/vqshape/blob/HEAD/vqshape/model.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":2,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0462bc29ff41ba2c"}},{"code_sha256_prefix":"07c547332969851f","entry":"AttributeDecoder","repo":"yunshiwen/vqshape","repo_kind":"official","path":"vqshape/model.py","file_url":"https://github.com/yunshiwen/vqshape/blob/HEAD/vqshape/model.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"07c547332969851f"}},{"code_sha256_prefix":"c4db2f888133a643","entry":"AttributeEncoder","repo":"yunshiwen/vqshape","repo_kind":"official","path":"vqshape/model.py","file_url":"https://github.com/yunshiwen/vqshape/blob/HEAD/vqshape/model.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c4db2f888133a643"}},{"code_sha256_prefix":"5b9a3f45827f6480","entry":"EuclCodebook","repo":"yunshiwen/vqshape","repo_kind":"official","path":"vqshape/model.py","file_url":"https://github.com/yunshiwen/vqshape/blob/HEAD/vqshape/model.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"5b9a3f45827f6480"}},{"code_sha256_prefix":"4f99f2fed9cb5821","entry":"MLP","repo":"yunshiwen/vqshape","repo_kind":"official","path":"vqshape/model.py","file_url":"https://github.com/yunshiwen/vqshape/blob/HEAD/vqshape/model.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4f99f2fed9cb5821"}},{"code_sha256_prefix":"c073a1bdab0b3a17","entry":"PatchDecoder","repo":"yunshiwen/vqshape","repo_kind":"official","path":"vqshape/model.py","file_url":"https://github.com/yunshiwen/vqshape/blob/HEAD/vqshape/model.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c073a1bdab0b3a17"}},{"code_sha256_prefix":"511d90614af70052","entry":"PositionalEmbedding","repo":"yunshiwen/vqshape","repo_kind":"official","path":"vqshape/model.py","file_url":"https://github.com/yunshiwen/vqshape/blob/HEAD/vqshape/model.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"511d90614af70052"}},{"code_sha256_prefix":"65ebfe790d7d756a","entry":"ShapeDecoder","repo":"yunshiwen/vqshape","repo_kind":"official","path":"vqshape/model.py","file_url":"https://github.com/yunshiwen/vqshape/blob/HEAD/vqshape/model.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"65ebfe790d7d756a"}},{"code_sha256_prefix":"5b84e11d45ccaa5b","entry":"Tokenizer","repo":"yunshiwen/vqshape","repo_kind":"official","path":"vqshape/model.py","file_url":"https://github.com/yunshiwen/vqshape/blob/HEAD/vqshape/model.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"5b84e11d45ccaa5b"}},{"code_sha256_prefix":"2a8f2551e933d3c4","entry":"entropy","repo":"yunshiwen/vqshape","repo_kind":"official","path":"vqshape/model.py","file_url":"https://github.com/yunshiwen/vqshape/blob/HEAD/vqshape/model.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2a8f2551e933d3c4"}},{"code_sha256_prefix":"7d6c3243647c53d9","entry":"log","repo":"yunshiwen/vqshape","repo_kind":"official","path":"vqshape/model.py","file_url":"https://github.com/yunshiwen/vqshape/blob/HEAD/vqshape/model.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"7d6c3243647c53d9"}},{"code_sha256_prefix":"9ba464786de3ce24","entry":"moving_average","repo":"yunshiwen/vqshape","repo_kind":"official","path":"vqshape/model.py","file_url":"https://github.com/yunshiwen/vqshape/blob/HEAD/vqshape/model.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9ba464786de3ce24"}},{"code_sha256_prefix":"345197a2330f9431","entry":"PatchEncoder","repo":"yunshiwen/vqshape","repo_kind":"official","path":"vqshape/model.py","file_url":"https://github.com/yunshiwen/vqshape/blob/HEAD/vqshape/model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"345197a2330f9431"}},{"code_sha256_prefix":"23c0d2db4c5b56e1","entry":"ResidualBlock","repo":"yunshiwen/vqshape","repo_kind":"official","path":"vqshape/model.py","file_url":"https://github.com/yunshiwen/vqshape/blob/HEAD/vqshape/model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"23c0d2db4c5b56e1"}},{"code_sha256_prefix":"057e558f53ab6bba","entry":"UpSampleBlock","repo":"yunshiwen/vqshape","repo_kind":"official","path":"vqshape/model.py","file_url":"https://github.com/yunshiwen/vqshape/blob/HEAD/vqshape/model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"057e558f53ab6bba"}},{"code_sha256_prefix":"7ced24bd1f8d6650","entry":"VQShape","repo":"yunshiwen/vqshape","repo_kind":"official","path":"vqshape/model.py","file_url":"https://github.com/yunshiwen/vqshape/blob/HEAD/vqshape/model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"7ced24bd1f8d6650"}},{"code_sha256_prefix":"93736ff984d5e424","entry":"eucl_sim_loss","repo":"yunshiwen/vqshape","repo_kind":"official","path":"vqshape/model.py","file_url":"https://github.com/yunshiwen/vqshape/blob/HEAD/vqshape/model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"93736ff984d5e424"}},{"code_sha256_prefix":"2d81b1059ee3e8b9","entry":"extract_subsequence","repo":"yunshiwen/vqshape","repo_kind":"official","path":"vqshape/model.py","file_url":"https://github.com/yunshiwen/vqshape/blob/HEAD/vqshape/model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2d81b1059ee3e8b9"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}