{"id":20542751,"url":"https://github.com/andrewrgarcia/time2vec","last_synced_at":"2025-09-25T17:31:00.706Z","repository":{"id":198933186,"uuid":"701822226","full_name":"andrewrgarcia/time2vec","owner":"andrewrgarcia","description":"Time2Vec neural network components. From paper: \"Time2Vec: Learning a Vector Representation of Time\" - https://arxiv.org/pdf/1907.05321.pdf","archived":false,"fork":false,"pushed_at":"2024-11-25T19:25:09.000Z","size":79,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-25T20:26:54.288Z","etag":null,"topics":["keras-tensorflow","layers","neural-networks","representation-learning","time-encoding","time-series","torch"],"latest_commit_sha":null,"homepage":"https://colab.research.google.com/drive/1P2BOAaQlo54SqYCsL8FFq1PffDjQuO1F?usp=sharing","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andrewrgarcia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-07T16:55:52.000Z","updated_at":"2024-11-25T19:26:58.000Z","dependencies_parsed_at":"2024-11-25T20:34:20.373Z","dependency_job_id":null,"html_url":"https://github.com/andrewrgarcia/time2vec","commit_stats":null,"previous_names":["andrewrgarcia/keras-time2vec","andrewrgarcia/time2vec-tensorflow"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewrgarcia%2Ftime2vec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewrgarcia%2Ftime2vec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewrgarcia%2Ftime2vec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewrgarcia%2Ftime2vec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrewrgarcia","download_url":"https://codeload.github.com/andrewrgarcia/time2vec/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234223590,"owners_count":18798719,"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":["keras-tensorflow","layers","neural-networks","representation-learning","time-encoding","time-series","torch"],"created_at":"2024-11-16T01:34:09.679Z","updated_at":"2025-09-25T17:30:55.443Z","avatar_url":"https://github.com/andrewrgarcia.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Time2Vec in Keras and Torch \n\nMy implementation of [Time2Vec: Learning a Vector representation of Time](https://arxiv.org/abs/1907.05321) as Keras and PyTorch Layers.\n\n# How to Use It\n\n**Head straight to our [Time2Vec Usage Template in Google Colab](https://colab.research.google.com/drive/1P2BOAaQlo54SqYCsL8FFq1PffDjQuO1F?usp=sharing)**\n\n# The Concept\n\nTime2Vec offers a versatile representation of time with three fundamental properties. It encapsulates scalar notion of time $\\tau$,  in $\\mathbf{t2v}(\\tau)$,\na vector of size k + 1. This transformation, for an $i^{th}$  element of $\\mathbf{t2v}$, is defined as follows:\n\n\n```math\n\\mathbf{t2v}(\\tau)[i] = \n    \\begin{cases}\n        \\omega_i \\tau + \\phi_i, \u0026 \\mathrm{if} \u0026 i = 0.\\\\\n        \\mathcal{F}(\\omega_i \\tau + \\phi_i), \u0026 \\mathrm{if} \u0026 1 \\leq i \\leq k.\n    \\end{cases}\n```\nThe above incorporates a periodic activation function denoted as $\\mathcal{F}$, and involves learnable parameters $\\omega_i$ and $\\phi_i$ [[1]](https://arxiv.org/abs/1907.05321). \n\n\n# Reference\n\n1. Seyed Mehran Kazemi, Rishab Goel, Sepehr Eghbali, Janahan Ramanan, Jaspreet Sahota, Sanjay Thakur, Stella Wu, Cathal Smyth, Pascal Poupart, Marcus Brubaker. \"Time2Vec: Learning a Vector Representation of Time.\" arXiv:1907.05321 [cs.LG], 11 Jul 2019. [Link](https://arxiv.org/abs/1907.05321)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewrgarcia%2Ftime2vec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewrgarcia%2Ftime2vec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewrgarcia%2Ftime2vec/lists"}