{"id":20196270,"url":"https://github.com/gpavanb1/nodefit","last_synced_at":"2025-04-10T10:43:12.440Z","repository":{"id":212917479,"uuid":"730810069","full_name":"gpavanb1/NODEFit","owner":"gpavanb1","description":"Fit time-series data with a Neural Differential Equation!","archived":false,"fork":false,"pushed_at":"2023-12-18T13:39:10.000Z","size":138,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T04:46:39.051Z","etag":null,"topics":["neural-network","neural-ode","numerical-methods","python","pytorch"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gpavanb1.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":"2023-12-12T18:10:25.000Z","updated_at":"2024-09-08T18:33:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"c6e05a8f-1415-4758-8d51-6dcfe10a88bd","html_url":"https://github.com/gpavanb1/NODEFit","commit_stats":null,"previous_names":["gpavanb1/nodefit"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gpavanb1%2FNODEFit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gpavanb1%2FNODEFit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gpavanb1%2FNODEFit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gpavanb1%2FNODEFit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gpavanb1","download_url":"https://codeload.github.com/gpavanb1/NODEFit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247980820,"owners_count":21027803,"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":["neural-network","neural-ode","numerical-methods","python","pytorch"],"created_at":"2024-11-14T04:22:59.534Z","updated_at":"2025-04-10T10:43:12.432Z","avatar_url":"https://github.com/gpavanb1.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NODEFit\n\n[![Downloads](https://pepy.tech/badge/nodefit)](https://pepy.tech/project/nodefit)\n\nFit time-series data with a Neural Differential Equation!\n\nThis repository contains time-series data fit capabilities using both Neural Ordinary Differential Equations and Neural Stochastic Differential Equations\n\nGPU support is packaged as part of [PyTorch](https://pytorch.org/)\n\n## How to install and execute?\n\nTested on Python 3.9\n\nJust run \n```\npip install nodefit\n```\n\nThe following program illustrates a basic example\n```python\nimport numpy as np\nimport torch.nn as nn\nfrom nodefit.constants import DEVICE\n\nfrom nodefit.neural_ode import NeuralODE\nfrom nodefit.neural_sde import NeuralSDE\n\n\n###\n# DEFINE NETWORKS\n###\n\n# Neural ODE parameters\nndim, drift_nhidden, diffusion_nhidden = 2, 10, 2\n\ndrift_nn = nn.Sequential(\n    nn.Linear(ndim+1, drift_nhidden),\n    nn.Sigmoid(),\n    nn.Linear(drift_nhidden, ndim)\n).double().to(DEVICE)\n\ndiffusion_nn = nn.Sequential(\n    nn.Linear(ndim+1, diffusion_nhidden),\n    nn.Sigmoid(),\n    nn.Linear(diffusion_nhidden, ndim)\n).double().to(DEVICE)\n\n###\n# PROVIDE DATA\n###\n\n# Training between data for 0 and 5 seconds\nt = np.linspace(0, 5, 10)\n# Provide data as list of lists with starting condition\ndata = np.array([[...]])\n\n###\n# FIT USING NEURALODE\n###\nprint('Performing fit using Neural ODE...')\n\nneural_ode = NeuralODE(drift_nn, t, data)\nneural_ode.train(2000)\n\n# # Extrapolate the training data to 10 seconds\nextra_data = neural_ode.extrapolate(10)\nneural_ode.plot(extra_data)\n\n###\n# FIT USING NEURALSDE\n###\nprint('Performing fit using Neural SDE...')\n\nneural_sde = NeuralSDE(drift_nn, diffusion_nn, t, data)\nneural_sde.train(1)\n\n# # Extrapolate the training data to 10 seconds\nextra_data = neural_sde.extrapolate(10)\nneural_sde.plot(extra_data)\n\n```\n\n## Sample Output\n\n![Sample Output](anim/output.gif)\n\n\n## Whom to contact?\n\nPlease direct your queries to [gpavanb1](http://github.com/gpavanb1)\nfor any questions.\n\n## Acknowledgements\n\nThis package would not be possible without the supporting packages - [torchdiffeq](https://github.com/rtqichen/torchdiffeq) and [torchsde](https://github.com/google-research/torchsde)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgpavanb1%2Fnodefit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgpavanb1%2Fnodefit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgpavanb1%2Fnodefit/lists"}