raminmh/CfC has 1,059 GitHub stars and 162 forks. GitHot measured +1 in 7 days. Last checked 2026-11-11 01:23 UTC. Last push 2024-07-05.
Closed-form Continuous-time Neural Networks
Measured star growth
- in 24h
- Update delayed
- in 7 days
- +1
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
OriginalClosed-form Continuous-time Models
Closed-form Continuous-time Neural Networks (CfCs) are powerful sequential liquid neural information processing units.
Paper Open Access: https://www.nature.com/articles/s42256-022-00556-7
Arxiv: https://arxiv.org/abs/2106.13898
A Tutorial on Liquid Neural Networks including Liquid CfCs: https://ncps.readthedocs.io/en/latest/quickstart.html
Requirements
- Python3.6 or newer
- Tensorflow 2.4 or newer
- PyTorch 1.8 or newer
- pytorch-lightning 1.3.0 or newer
- scikit-learn 0.24.2 or newer
Module description
tf_cfc.pyImplementation of the CfC (various versions) in Tensorflow 2.xtorch_cfc.pyImplementation of the CfC (various versions) in PyTorchtrain_physio.pyTrains the CfC models on the Physionet 2012 dataset in PyTorch (code adapted from Rubanova et al. 2019)train_xor.pyTrains the CfC models on the XOR dataset in Tensorflow (code adapted from Lechner & Hasani, 2020)train_imdb.pyTrains the CfC models on the IMDB dataset in Tensorflow (code adapted from Keras examples website)train_walker.pyTrains the CfC models on the Walker2d dataset in Tensorflow (code adapted from Lechner & Hasani, 2020)irregular_sampled_datasets.pyDatasets (same splits) from Lechner & Hasani (2020)duv_physionet.pyandduv_utils.pyPhysionet dataset (same split) from Rubanova et al. (2019)
Usage
All training scripts except the following three flags
no_gateRuns the CfC without the (1-sigmoid) partminimalRuns the CfC direct solutionuse_ltcRuns an LTC with a semi-implicit ODE solver instead of a CfCuse_mixedMixes the CfC's RNN-state with a LSTM to avoid vanishing gradients
If none of these flags are provided, the full CfC model is used
For instance
python3 train_physio.py
train the full CfC model on the Physionet dataset.
Similarly
train_walker.py --minimal
runs the direct CfC solution on the walker2d dataset.
For downloading the Walker2d dataset of Lechner & Hasani 2020, run
source download_dataset.sh
Cite
@article{hasani_closed-form_2022,
title = {Closed-form continuous-time neural networks},
journal = {Nature Machine Intelligence},
author = {Hasani, Ramin and Lechner, Mathias and Amini, Alexander and Liebenwein, Lucas and Ray, Aaron and Tschaikowski, Max and Teschl, Gerald and Rus, Daniela},
issn = {2522-5839},
month = nov,
year = {2022},
}
Explore related projects
tensorflow/tensorflow
An Open Source Machine Learning Framework for Everyone
201,427 starshuggingface/transformers
🤗 Transformers: the model-definition framework for state-of-the-art machine learning models in text, vision, audio, and multimodal models, for both inference and training.
168,711 starsAUTOMATIC1111/stable-diffusion-webui
Stable Diffusion web UI
165,274 starsComfy-Org/ComfyUI
The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.
146,024 stars