{"id":13526406,"url":"https://github.com/patrick-kidger/NeuralCDE","last_synced_at":"2025-04-01T07:32:19.785Z","repository":{"id":51225080,"uuid":"264925559","full_name":"patrick-kidger/NeuralCDE","owner":"patrick-kidger","description":"Code for \"Neural Controlled Differential Equations for Irregular Time Series\" (Neurips 2020 Spotlight)","archived":false,"fork":false,"pushed_at":"2022-10-22T13:32:29.000Z","size":630,"stargazers_count":646,"open_issues_count":4,"forks_count":70,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-03-29T02:06:37.603Z","etag":null,"topics":["controlled-differential-equations","deep-learning","deep-neural-networks","differential-equations","dynamical-systems","machine-learning","neural-differential-equations","neural-networks","pytorch","rough-paths","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/patrick-kidger.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}},"created_at":"2020-05-18T12:00:22.000Z","updated_at":"2025-03-25T09:35:57.000Z","dependencies_parsed_at":"2023-01-20T08:10:50.443Z","dependency_job_id":null,"html_url":"https://github.com/patrick-kidger/NeuralCDE","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/patrick-kidger%2FNeuralCDE","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrick-kidger%2FNeuralCDE/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrick-kidger%2FNeuralCDE/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrick-kidger%2FNeuralCDE/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patrick-kidger","download_url":"https://codeload.github.com/patrick-kidger/NeuralCDE/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246600791,"owners_count":20803485,"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":["controlled-differential-equations","deep-learning","deep-neural-networks","differential-equations","dynamical-systems","machine-learning","neural-differential-equations","neural-networks","pytorch","rough-paths","time-series"],"created_at":"2024-08-01T06:01:29.229Z","updated_at":"2025-04-01T07:32:14.776Z","avatar_url":"https://github.com/patrick-kidger.png","language":"Python","funding_links":[],"categories":["Papers","Python"],"sub_categories":["2020"],"readme":"\u003ch1 align='center'\u003e Neural Controlled Differential Equations for Irregular Time Series\u003cbr\u003e(NeurIPS 2020 Spotlight)\u003cbr\u003e\n    [\u003ca href=\"https://arxiv.org/abs/2005.08926\"\u003earXiv\u003c/a\u003e, \u003ca href=\"https://www.youtube.com/watch?v=sbcIKugElZ4\"\u003eYouTube\u003c/a\u003e] \u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cimg align=\"middle\" src=\"./imgs/main.png\" width=\"666\" /\u003e\n\u003c/p\u003e\n\nBuilding on the well-understood mathematical theory of _controlled differential equations_, we demonstrate how to construct models that:\n+ Act directly on irregularly-sampled partially-observed multivariate time series.\n+ May be trained with memory-efficient adjoint backpropagation - even across observations.\n+ Demonstrate state-of-the-art performance.\n\nThey are straightforward to implement and evaluate using existing tools, in particular PyTorch and the [`torchcde`](https://github.com/patrick-kidger/torchcde) library.\n\n----\n\n### Library\nSee [`torchcde`](https://github.com/patrick-kidger/torchcde).\n\n### Example\nWe encourage looking at [example.py](https://github.com/patrick-kidger/torchcde/blob/master/example/example.py), which demonstrates how to use the library to train a Neural CDE model to predict the chirality of a spiral.\n\nAlso see [irregular_data.py](https://github.com/patrick-kidger/torchcde/blob/master/example/irregular_data.py), for demonstrations on how to handle variable-length inputs, irregular sampling, or missing data, all of which can be handled easily, without changing the model.\n\nA self contained short example:\n```python\nimport torch\nimport torchcde\n\n# Create some data\nbatch, length, input_channels = 1, 10, 2\nhidden_channels = 3\nt = torch.linspace(0, 1, length)\nt_ = t.unsqueeze(0).unsqueeze(-1).expand(batch, length, 1)\nx_ = torch.rand(batch, length, input_channels - 1)\nx = torch.cat([t_, x_], dim=2)  # include time as a channel\n\n# Interpolate it\ncoeffs = torchcde.natural_cubic_spline_coeffs(x)\nX = torchcde.NaturalCubicSpline(coeffs)\n\n# Create the Neural CDE system\nclass F(torch.nn.Module):\n    def __init__(self):\n        super(F, self).__init__()\n        self.linear = torch.nn.Linear(hidden_channels, \n                                      hidden_channels * input_channels)\n    def forward(self, t, z):\n        return self.linear(z).view(batch, hidden_channels, input_channels)\n\nfunc = F()\nz0 = torch.rand(batch, hidden_channels)\n\n# Integrate it\ntorchcde.cdeint(X=X, func=func, z0=z0, t=X.interval)\n```\n\n\u003cp align=\"center\"\u003e\n\u003cimg align=\"middle\" src=\"./imgs/spiral.png\" width=\"666\" /\u003e\n\u003c/p\u003e\n\n### Reproducing experiments\nEverything to reproduce the experiments of the paper can be found in the [`experiments` folder](./experiments). Check the folder for details.\n\n### Results\nAs an example (taken from the paper - have a look there for similar results on other datasets):\n\n\u003cp align=\"center\"\u003e\n\u003cimg align=\"middle\" src=\"./imgs/ct.png\" width=\"666\" /\u003e\n\u003c/p\u003e\n\n### Citation\n```bibtex\n@article{kidger2020neuralcde,\n    title={{N}eural {C}ontrolled {D}ifferential {E}quations for {I}rregular {T}ime {S}eries},\n    author={Kidger, Patrick and Morrill, James and Foster, James and Lyons, Terry},\n    journal={Advances in Neural Information Processing Systems},\n    year={2020}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrick-kidger%2FNeuralCDE","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatrick-kidger%2FNeuralCDE","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrick-kidger%2FNeuralCDE/lists"}