{"id":20297921,"url":"https://github.com/raminmh/liquid_time_constant_networks","last_synced_at":"2025-05-15T17:01:38.995Z","repository":{"id":48134081,"uuid":"265540002","full_name":"raminmh/liquid_time_constant_networks","owner":"raminmh","description":"Code Repository for Liquid Time-Constant Networks (LTCs)","archived":false,"fork":false,"pushed_at":"2024-06-03T17:18:14.000Z","size":4057,"stargazers_count":1643,"open_issues_count":9,"forks_count":305,"subscribers_count":70,"default_branch":"master","last_synced_at":"2025-04-03T12:07:08.222Z","etag":null,"topics":["deep-learning","liquid-neural-networks","recurrent-neural-networks","sequence-modeling","state-space-models","time-series"],"latest_commit_sha":null,"homepage":"https://arxiv.org/abs/2006.04439","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/raminmh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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-05-20T11:10:53.000Z","updated_at":"2025-04-03T12:03:12.000Z","dependencies_parsed_at":"2024-12-25T22:07:04.475Z","dependency_job_id":"8f4bea2b-53aa-4ed7-93ee-008659c171d3","html_url":"https://github.com/raminmh/liquid_time_constant_networks","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/raminmh%2Fliquid_time_constant_networks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raminmh%2Fliquid_time_constant_networks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raminmh%2Fliquid_time_constant_networks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raminmh%2Fliquid_time_constant_networks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raminmh","download_url":"https://codeload.github.com/raminmh/liquid_time_constant_networks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248489066,"owners_count":21112493,"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","liquid-neural-networks","recurrent-neural-networks","sequence-modeling","state-space-models","time-series"],"created_at":"2024-11-14T16:01:20.860Z","updated_at":"2025-04-11T22:28:23.868Z","avatar_url":"https://github.com/raminmh.png","language":"Python","funding_links":[],"categories":["其他_机器学习与深度学习","Frameworks"],"sub_categories":[],"readme":"# Liquid time-constant Networks (LTCs)\n\n[Update] A Pytorch version together with tutorials are added to our sister repository: \n[https://github.com/mlech26l/ncps](https://github.com/mlech26l/ncps)\n\nThis is the official repository for LTC networks described in the paper: https://arxiv.org/abs/2006.04439\nThis repository allows you to train continuous-time models with backpropagation through-time (BPTT). Available Continuous-time models are: \n| Models | References |\n| ----- | ----- |\n| Liquid time-constant Networks | https://arxiv.org/abs/2006.04439 |\n| Neural ODEs | https://papers.nips.cc/paper/7892-neural-ordinary-differential-equations.pdf |\n| Continuous-time RNNs | https://www.sciencedirect.com/science/article/abs/pii/S089360800580125X |\nContinuous-time Gated Recurrent Units (GRU) | https://arxiv.org/abs/1710.04110 |\n\n## Requisites\n\nAll models were implemented and tested with TensorFlow 1.14.0 and python3 on Ubuntu 16.04 and 18.04 machines.\nAll the following steps assume that they are executed under these conditions.\n\n## Preparation\n\nFirst, we have to download all datasets by running \n```bash\nsource download_datasets.sh\n```\nThis script creates a folder ```data```, where all downloaded datasets are stored.\n\n## Training and evaluating the models \n\nThere is exactly one Python module per dataset:\n- Hand gesture segmentation: ```gesture.py```\n- Room occupancy detection: ```occupancy.py```\n- Human activity recognition: ```har.py```\n- Traffic volume prediction: ```traffic.py```\n- Ozone level forecasting: ```ozone.py```\n\nEach script accepts the following four arguments:\n- ```--model: lstm | ctrnn | ltc | ltc_rk | ltc_ex```\n- ```--epochs: number of training epochs (default 200)```\n- ```--size: number of hidden RNN units  (default 32)```\n- ```--log: interval of how often to evaluate validation metric (default 1)```\n\nEach script trains the specified model for the given number of epochs and evaluates the\nvalidation performance after every ``log`` steps.\nAt the end of the training, the best-performing checkpoint is restored and the model is evaluated on the test set.\nAll results are stored in the ```results``` folder by appending the result to CSV file.\n\nFor example, we can train and evaluate the CT-RNN by executing\n```bash\npython3 har.py --model ctrnn\n```\nAfter the script is finished there should be a file ```results/har/ctrnn_32.csv``` created, containing the following columns:\n- ```best epoch```: Epoch number that achieved the best validation metric\n- ```train loss```: Training loss achieved at the best epoch\n- ```train accuracy```: Training metric achieved at the best epoch\n- ```valid loss```: Validation loss achieved at the best epoch\n- ```valid accuracy```: Best validation metric achieved during training\n- ```test loss```: Loss on the test set\n- ```test accuracy```: Metric on the test set\n\n## Hyperparameters\n\n| Parameter | Value | Description | \n| ---- | ---- | ------ |\n| Minibatch size | 16 | Number of training samples over which the gradient descent update is computed |\n| Learning rate | 0.001/0.02 | 0.01-0.02 for LTC, 0.001 for all other models. |\n| Hidden units | 32 | Number of hidden units of each model |\n| Optimizer | Adam | See (Kingma and Ba, 2014) |\n| beta_1 | 0.9 | Parameter of the Adam method |\n| beta_2 | 0.999 | Parameter of the Adam method |\n| epsilon | 1e-08 | Epsilon-hat parameter of the Adam method |\n| Number of epochs | 200 | Maximum number of training epochs |\n| BPTT length | 32 | Backpropagation through time length in time-steps | \n| ODE solver sreps | 1/6 | relative to input sampling period |\n| Validation evaluation interval | 1 | Interval of training epochs when the metrics on the validation are evaluated  | \n\n\n# Trajectory Length Analysis\n\nRun the ```main.m``` file to get trajectory length results for the desired setting tuneable in the code. \n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framinmh%2Fliquid_time_constant_networks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Framinmh%2Fliquid_time_constant_networks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framinmh%2Fliquid_time_constant_networks/lists"}