{"id":23219778,"url":"https://github.com/raminmh/cfc","last_synced_at":"2025-05-16T11:04:39.286Z","repository":{"id":63286563,"uuid":"328077563","full_name":"raminmh/CfC","owner":"raminmh","description":"Closed-form Continuous-time Neural Networks","archived":false,"fork":false,"pushed_at":"2024-07-05T00:34:15.000Z","size":97996,"stargazers_count":939,"open_issues_count":11,"forks_count":153,"subscribers_count":32,"default_branch":"main","last_synced_at":"2025-04-12T08:16:44.888Z","etag":null,"topics":["deep-learning","neural-ode","pytorch","recurrent-neural-networks","sequence-models","tensorflow"],"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/raminmh.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":"2021-01-09T04:55:21.000Z","updated_at":"2025-04-11T15:35:28.000Z","dependencies_parsed_at":"2024-12-25T22:07:07.380Z","dependency_job_id":"f67fda3a-42fd-4a39-9b0b-89efb9d03412","html_url":"https://github.com/raminmh/CfC","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raminmh%2FCfC","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raminmh%2FCfC/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raminmh%2FCfC/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raminmh%2FCfC/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raminmh","download_url":"https://codeload.github.com/raminmh/CfC/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254518384,"owners_count":22084374,"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","neural-ode","pytorch","recurrent-neural-networks","sequence-models","tensorflow"],"created_at":"2024-12-18T21:40:29.052Z","updated_at":"2025-05-16T11:04:34.276Z","avatar_url":"https://github.com/raminmh.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Closed-form Continuous-time Models\n\nClosed-form Continuous-time Neural Networks (CfCs) are powerful sequential liquid neural information processing units. \n\nPaper Open Access: https://www.nature.com/articles/s42256-022-00556-7\n\nArxiv: https://arxiv.org/abs/2106.13898\n\nA Tutorial on Liquid Neural Networks including Liquid CfCs: https://ncps.readthedocs.io/en/latest/quickstart.html\n\n## Requirements\n\n- Python3.6 or newer\n- Tensorflow 2.4 or newer\n- PyTorch 1.8 or newer\n- pytorch-lightning 1.3.0 or newer\n- scikit-learn 0.24.2 or newer\n\n## Module description\n\n- ```tf_cfc.py``` Implementation of the CfC (various versions) in Tensorflow 2.x\n- ```torch_cfc.py``` Implementation of the CfC (various versions) in PyTorch\n- ```train_physio.py``` Trains the CfC models on the Physionet 2012 dataset in PyTorch (code adapted from Rubanova et al. 2019)\n- ```train_xor.py``` Trains the CfC models on the XOR dataset in Tensorflow (code adapted from Lechner \u0026 Hasani, 2020)\n- ```train_imdb.py``` Trains the CfC models on the IMDB dataset in Tensorflow (code adapted from Keras examples website)\n- ```train_walker.py``` Trains the CfC models on the Walker2d dataset in Tensorflow (code adapted from Lechner \u0026 Hasani, 2020)\n- ```irregular_sampled_datasets.py``` Datasets (same splits) from Lechner \u0026 Hasani (2020)\n- ```duv_physionet.py``` and ```duv_utils.py``` Physionet dataset (same split) from Rubanova et al. (2019)\n\n## Usage\n\nAll training scripts except the following three flags\n\n- ```no_gate``` Runs the CfC without the (1-sigmoid) part\n- ```minimal``` Runs the CfC direct solution\n- ```use_ltc``` Runs an LTC with a semi-implicit ODE solver instead of a CfC\n- ```use_mixed``` Mixes the CfC's RNN-state with a LSTM to avoid vanishing gradients\n\nIf none of these flags are provided, the full CfC model is used\n\nFor instance \n\n```bash\npython3 train_physio.py\n```\n\ntrain the full CfC model on the Physionet dataset.\n\nSimilarly\n\n```bash\ntrain_walker.py --minimal\n```\n\nruns the direct CfC solution on the walker2d dataset.\n\nFor downloading the Walker2d dataset of Lechner \u0026 Hasani 2020, run \n\n```bash\nsource download_dataset.sh\n```\n\n## Cite\n\n```\n@article{hasani_closed-form_2022,\n\ttitle = {Closed-form continuous-time neural networks},\n\tjournal = {Nature Machine Intelligence},\n\tauthor = {Hasani, Ramin and Lechner, Mathias and Amini, Alexander and Liebenwein, Lucas and Ray, Aaron and Tschaikowski, Max and Teschl, Gerald and Rus, Daniela},\n\tissn = {2522-5839},\n\tmonth = nov,\n\tyear = {2022},\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framinmh%2Fcfc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Framinmh%2Fcfc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framinmh%2Fcfc/lists"}