Closed-form Continuous-time Models
Closed-form Continuous-time Neural Networks (CfCs) are powerful sequential neural information processing units.
Paper Open Access: https://www.nature.com/articles/s42256-022-00556-7
Arxiv: https://arxiv.org/abs/2106.13898
Installation
pip install cfc-model
Requirements
- Python 3.7 or newer
- Tensorflow 2.4 or newer
- Pandas
- Numpy
For a fresh anaconda environment with the required dependencies:
conda env create --file environment.yml
conda activate cfc
Usage
Example
from cfc_model.dense_models import SequentialModel
import numpy as np
X = np.array([[1, 1, 1, 0], [1, 1, 0, 1], [1, 0, 0, 1], [1, 1, 0, 0],
[1, 0, 1, 0], [1, 1, 0, 1], [1, 0, 0, 1], [1, 0, 1, 0]])
y = np.array([0, 0, 1, 1, 1, 0, 1, 1])
model = SequentialModel()
model.fit(X, y)
y_pred = model.predict([1, 1, 0, 1]) # y_pred equals 0
Configuration
The following configuration states can be used
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
Example
# Runs an LTC with a semi-implicit ODE solver instead of a CfC
config = {"use_ltc": True}
model.fit(X, y, config=config)
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}
Metadata
Release files for cfc-model 1.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cfc_model-1.1.4.tar.gz | 23.0 MB | Without provenance | Details for cfc_model-1.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cfc_model-1.1.4-py3-none-any.whl | Python 3 | none | any | Details for cfc_model-1.1.4-py3-none-any.whl |
Total release size: 46.0 MB
Release files / cfc_model-1.1.4.tar.gz
| Download URL | cfc_model-1.1.4.tar.gz |
|---|---|
| Size | 23.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5efdc17a387b9f9898f083cee8f58319ea4031f5c429584a0456ffd11fde61d3
|
|
BLAKE2b-256 checksum How to use checksums |
5419a30a83190c9a8775fc14fd02110ba766152f409d22dfeba8b6121995df85
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.0
|
Release files / cfc_model-1.1.4-py3-none-any.whl
| Download URL | cfc_model-1.1.4-py3-none-any.whl |
|---|---|
| Size | 23.0 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6d399ac183383112aeac8af560f9cb77172a3e4ce8df8d05ab77498c7e5c56a5
|
|
BLAKE2b-256 checksum How to use checksums |
3c173225c5fc8a9efb50e6d1e3499d99bc1687efbe2e4bebad622b5a67a32373
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.0
|
Security for cfc-model 1.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.