{"id":20382830,"url":"https://github.com/lava-nc/lava-dnf","last_synced_at":"2025-04-06T06:09:42.790Z","repository":{"id":40236325,"uuid":"411731604","full_name":"lava-nc/lava-dnf","owner":"lava-nc","description":"Dynamic Neural Fields with Lava","archived":false,"fork":false,"pushed_at":"2025-03-25T18:51:40.000Z","size":13613,"stargazers_count":45,"open_issues_count":5,"forks_count":17,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-03-30T05:07:50.152Z","etag":null,"topics":["dynamic-neural-fields","neuromorphic","neuromorphic-computing","python"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lava-nc.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-29T15:34:58.000Z","updated_at":"2025-03-25T18:51:37.000Z","dependencies_parsed_at":"2023-02-10T10:01:27.636Z","dependency_job_id":"44d43390-4cd8-49be-9ff9-50d9fa7b6f8d","html_url":"https://github.com/lava-nc/lava-dnf","commit_stats":{"total_commits":45,"total_committers":13,"mean_commits":"3.4615384615384617","dds":0.7111111111111111,"last_synced_commit":"0592f07cf46f76a35ab0da0d711153fa30b59586"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lava-nc%2Flava-dnf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lava-nc%2Flava-dnf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lava-nc%2Flava-dnf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lava-nc%2Flava-dnf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lava-nc","download_url":"https://codeload.github.com/lava-nc/lava-dnf/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247441052,"owners_count":20939239,"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":["dynamic-neural-fields","neuromorphic","neuromorphic-computing","python"],"created_at":"2024-11-15T02:19:10.305Z","updated_at":"2025-04-06T06:09:42.769Z","avatar_url":"https://github.com/lava-nc.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dynamic Neural Fields\n\n## Introduction\n\nDynamic Neural Fields (DNF) are neural attractor networks that generate\nstabilized activity patterns in recurrently connected populations of neurons.\nThese activity patterns form the basis of neural representations, decision\nmaking, working memory, and learning. DNFs are the fundamental\nbuilding block of [dynamic field theory](https://dynamicfieldtheory.org),\na mathematical and conceptual framework for modeling cognitive processes in\na closed behavioral loop.\n\n![2D DNF tracking bias input](https://user-images.githubusercontent.com/5708333/135443996-7492b968-277a-4397-9b1c-597b7af4a699.gif)\u003cbr\u003e\n*Voltage of a selective dynamic neural field tracking moving input*\n\n## What is lava-dnf?\n\nlava-dnf is a library within the Lava software framework. The main building \nblocks in Lava are processes. lava-dnf provides\nprocesses and other software infrastructure to build architectures composed of\nDNFs. In particular, it provides functions that generate connectivity patterns\ncommon to DNF architectures.\n\nThe primary focus of lava-dnf today is on robotic applications: sensing and\nperception, motion control, behavioral organization, map formation, and\nautonomous (continual) learning. Neuromorphic hardware provides significant\ngains in both processing speed and energy efficiency compared to conventional\nimplementations of DNFs on a CPU or GPU (e.g., using\n[cedar](https://cedar.ini.rub.de) or [cosivina](https://github.com/cosivina)).\n\n## Key features\n\nBuilding DNF architectures\n- Based on spiking neurons\n- DNF dimensionality support for 0D, 1D, 2D, and 3D\n- Recurrent connectivity based on kernel functions\n- Forward connectivity to connect multiple DNFs\n- Structured input from spike generators\n\nRunning DNF architectures\n- On CPU (Python simulation)\n- On Loihi 2\n\nExamples demonstrating basic DNF regimes and instabilities\n- Detection of input\n- Selection of input\n- Working memory of input\n- Relational networks\n\n\n## Installation\nWe highly recommend cloning the repository and using poetry to set up lava-dnf, provided you only want to run lava-dnf \nin simulation. This will automatically also install lava. \n\nNote: For INRC members who want to run lava-dnf on Loihi 2 hardware, we recommend following the \n[install instructions for the Lava-on-Loihi extension](https://intel-ncl.atlassian.net/wiki/spaces/NAP/pages/1785856001/Setup+Lava+extension+for+Loihi).\n\n#### Linux/MacOS\n```bash\n$ cd $HOME\n$ git clone git@github.com:lava-nc/lava-dnf.git\n$ cd lava-dnf\n$ curl -sSL https://install.python-poetry.org | python3\n$ poetry config virtualenvs.in-project true\n$ poetry install\n$ source .venv/bin/activate\n$ pytest\n```\n#### Windows (PowerShell)\n```cmdlet\n# Commands using PowerShell\ncd $HOME\ngit clone https://github.com/lava-nc/lava-dnf.git\ncd lava-dnf\npython -m venv .venv\nset-executionpolicy remotesigned  # only required on first execution\n.venv\\Scripts\\activate\ncurl.exe -sSL https://install.python-poetry.org | python -\n# Include the directory where poetry was installed into the PATH variable.\npip install -U pip\npoetry config virtualenvs.in-project true\npoetry install\npytest\n```\nYou should expect the following output after running the unit tests with `pytest`.\n```\n$ pytest\n================================================= test session starts =================================================\nplatform win32 -- Python 3.9.12, pytest-7.2.0, pluggy-1.0.0\nrootdir: C:\\Users\\username\\lava-dnf, configfile: pyproject.toml, testpaths: tests\nplugins: cov-3.0.0\ncollected 210 items\n\ntests\\lava\\lib\\dnf\\acceptance\\test_connecting_with_ops.py .......                                                [  3%]\ntests\\lava\\lib\\dnf\\acceptance\\test_gauss_spike_generator.py .                                                    [  3%]\ntests\\lava\\lib\\dnf\\connect\\test_connect.py .............                                                         [ 10%]\ntests\\lava\\lib\\dnf\\connect\\test_exceptions.py .                                                                  [ 10%]\n[...]\ntests\\lava\\lib\\dnf\\utils\\test_plotting.py ....                                                                   [ 96%]\ntests\\lava\\lib\\dnf\\utils\\test_validation.py .....                                                                [ 98%]\ntests\\lava\\tutorials\\test_tutorials.py sss                                                                       [100%]\n\n=============================== warnings summary ===============================\n[...]\n\n---------- coverage: platform win32, python 3.9.12-final-0 -----------\nName                                                     Stmts   Miss  Cover   Missing\n--------------------------------------------------------------------------------------\nsrc\\lava\\lib\\dnf\\connect\\connect.py                         49      0   100%\nsrc\\lava\\lib\\dnf\\connect\\exceptions.py                       6      1    83%   20\n[...]\nsrc\\lava\\lib\\dnf\\utils\\plotting.py                          29      0   100%\nsrc\\lava\\lib\\dnf\\utils\\validation.py                        18      2    89%   28, 38\n--------------------------------------------------------------------------------------\nTOTAL                                                      806     13    98%\n\nRequired test coverage of 65.0% reached. Total coverage: 98.39%\n===================================== 207 passed, 3 skipped, 2 warnings in 28.78s =====================================\n```\n\n## Example\n\n```python\nfrom lava.proc.lif.process import LIF\nfrom lava.lib.dnf.kernels.kernels import SelectiveKernel\nfrom lava.lib.dnf.connect.connect import connect\nfrom lava.lib.dnf.operations.operations import Convolution\n\n# Create a population of 20x20 spiking neurons.\ndnf = LIF(shape=(20, 20))\n\n# Create a selective kernel.\nkernel = SelectiveKernel(amp_exc=18, width_exc=[4, 4], global_inh=-15)\n\n# Apply the kernel to the population to create a DNF with a selective regime.\nconnect(dnf.s_out, dnf.a_in, [Convolution(kernel)])\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flava-nc%2Flava-dnf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flava-nc%2Flava-dnf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flava-nc%2Flava-dnf/lists"}