{"id":15521383,"url":"https://github.com/julesbelveze/time-series-autoencoder","last_synced_at":"2025-05-15T10:07:15.620Z","repository":{"id":40204191,"uuid":"269587269","full_name":"JulesBelveze/time-series-autoencoder","owner":"JulesBelveze","description":"PyTorch Dual-Attention LSTM-Autoencoder For Multivariate Time Series","archived":false,"fork":false,"pushed_at":"2025-03-06T04:19:27.000Z","size":351,"stargazers_count":675,"open_issues_count":9,"forks_count":67,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-15T10:06:35.655Z","etag":null,"topics":["attention-mechanisms","autoencoder","forecasting","lstm-autoencoder","multivariate-timeseries","pytorch","time-series"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JulesBelveze.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":"2020-06-05T09:31:36.000Z","updated_at":"2025-05-13T07:44:24.000Z","dependencies_parsed_at":"2025-03-17T06:01:38.500Z","dependency_job_id":null,"html_url":"https://github.com/JulesBelveze/time-series-autoencoder","commit_stats":{"total_commits":29,"total_committers":5,"mean_commits":5.8,"dds":0.6206896551724138,"last_synced_commit":"b5bc494feede13684467adf6ec200a5835e91e8a"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JulesBelveze%2Ftime-series-autoencoder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JulesBelveze%2Ftime-series-autoencoder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JulesBelveze%2Ftime-series-autoencoder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JulesBelveze%2Ftime-series-autoencoder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JulesBelveze","download_url":"https://codeload.github.com/JulesBelveze/time-series-autoencoder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254319722,"owners_count":22051074,"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":["attention-mechanisms","autoencoder","forecasting","lstm-autoencoder","multivariate-timeseries","pytorch","time-series"],"created_at":"2024-10-02T10:34:22.687Z","updated_at":"2025-05-15T10:07:10.594Z","avatar_url":"https://github.com/JulesBelveze.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eLSTM-autoencoder with attentions for multivariate time series\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://hitcounter.pythonanywhere.com/count/tag.svg?url=https%3A%2F%2Fgithub.com%2FJulesBelveze%2Ftime-series-autoencoder\" alt=\"Hits\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Made%20with-Python-1f425f.svg\"\u003e\n\u003c/p\u003e\n\nThis repository contains an autoencoder for multivariate time series forecasting.\nIt features two attention mechanisms described\nin *[A Dual-Stage Attention-Based Recurrent Neural Network for Time Series Prediction](https://arxiv.org/abs/1704.02971)*\nand was inspired by [Seanny123's repository](https://github.com/Seanny123/da-rnn).\n\n![Autoencoder architecture](autoenc_architecture.png)\n\n## Download and dependencies\n\nTo clone the repository please run:\n\n```\ngit clone https://github.com/JulesBelveze/time-series-autoencoder.git\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eUse uv\u003c/summary\u003e\n\nThen install `uv` \n```shell\n# install uv\ncurl -LsSf https://astral.sh/uv/install.sh | sh  # linux/mac\n# or\nbrew install uv  # mac with homebrew\n```\n\n# setup environment and install dependencies\n```bash\ncd time-series-autoencoder\nuv venv\nuv pip sync pyproject.toml\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eInstall directly from requirements.txt\u003c/summary\u003e\n\n```shell\npip install -r requirements.txt\n```\n\n\u003c/details\u003e\n\n## Usage\n\nThe project uses [Hydra](https://hydra.cc/docs/intro/) as a configuration parser. You can simply change the parameters\ndirectly within your `.yaml` file or you can override/set parameter using flags (for a complete guide please refer to\nthe docs).\n\n```\npython3 main.py -cn=[PATH_TO_FOLDER_CONFIG] -cp=[CONFIG_NAME]\n```\n\nOptional arguments:\n\n```  \n  -h, --help            show this help message and exit\n  --batch-size BATCH_SIZE\n                        batch size\n  --output-size OUTPUT_SIZE\n                        size of the ouput: default value to 1 for forecasting\n  --label-col LABEL_COL\n                        name of the target column\n  --input-att INPUT_ATT\n                        whether or not activate the input attention mechanism\n  --temporal-att TEMPORAL_ATT\n                        whether or not activate the temporal attention\n                        mechanism\n  --seq-len SEQ_LEN     window length to use for forecasting\n  --hidden-size-encoder HIDDEN_SIZE_ENCODER\n                        size of the encoder's hidden states\n  --hidden-size-decoder HIDDEN_SIZE_DECODER\n                        size of the decoder's hidden states\n  --reg-factor1 REG_FACTOR1\n                        contribution factor of the L1 regularization if using\n                        a sparse autoencoder\n  --reg-factor2 REG_FACTOR2\n                        contribution factor of the L2 regularization if using\n                        a sparse autoencoder\n  --reg1 REG1           activate/deactivate L1 regularization\n  --reg2 REG2           activate/deactivate L2 regularization\n  --denoising DENOISING\n                        whether or not to use a denoising autoencoder\n  --do-train DO_TRAIN   whether or not to train the model\n  --do-eval DO_EVAL     whether or not evaluating the mode\n  --data-path DATA_PATH\n                        path to data file\n  --output-dir OUTPUT_DIR\n                        name of folder to output files\n  --ckpt CKPT           checkpoint path for evaluation \n  ```\n\n## Features\n\n* handles multivariate time series\n* attention mechanisms\n* denoising autoencoder\n* sparse autoencoder\n\n## Examples\n\nYou can find under the `examples` scripts to train the model in both cases:\n\n* reconstruction: the dataset can be found [here](https://gist.github.com/JulesBelveze/99ecdbea62f81ce647b131e7badbb24a)\n* forecasting: the dataset can be found [here](https://gist.github.com/JulesBelveze/e9997b9b0b68101029b461baf698bd72)\n  \n  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjulesbelveze%2Ftime-series-autoencoder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjulesbelveze%2Ftime-series-autoencoder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjulesbelveze%2Ftime-series-autoencoder/lists"}