Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial release of lava-dnf v0.1.0 #8

Merged
merged 121 commits into from
Nov 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
121 commits
Select commit Hold shift + click to select a range
c65034c
Removed placeholder file
mathisrichter Oct 30, 2021
475a96e
Removed 'lib' from gitignore
mathisrichter Oct 30, 2021
758ff16
Added Population Process and shape validation
mathisrichter Oct 30, 2021
bd2c0e3
Added Population SubProcessModel
mathisrichter Oct 30, 2021
d67a5fb
Make unit test for Population ProcessModel ports more explicit
mathisrichter Oct 30, 2021
bfe5271
Unit test that executes a Population
mathisrichter Nov 2, 2021
f12829c
Modified Population ProcessModel unit test to use get_src_ports/get_d…
mathisrichter Nov 3, 2021
60df0a8
Added convenience function num_neurons()
mathisrichter Nov 3, 2021
c8de0a9
Added first version of connect() function
mathisrichter Nov 3, 2021
04c25ae
Added missing __init__ file
mathisrichter Nov 3, 2021
08051dd
Added num_dims function
mathisrichter Nov 4, 2021
920a9ac
Added configuration functionality to operations
mathisrichter Nov 4, 2021
1803c21
Added basic configuration of operations in connect()
mathisrichter Nov 4, 2021
e08750e
Added additional top-level lava directory and moved lib inside
mathisrichter Nov 4, 2021
6a607dd
Refactored connect unit tests
mathisrichter Nov 4, 2021
498238b
Added check for multiple operations that change shape (not yet implem…
mathisrichter Nov 4, 2021
a2ce8a9
Weights are computed for all operations
mathisrichter Nov 4, 2021
34fcadc
Fixed linter error
mathisrichter Nov 4, 2021
7d7eafe
Unit testing only against the public API of connect
mathisrichter Nov 4, 2021
17526b0
Doc strings for operations module
mathisrichter Nov 4, 2021
534348e
Added exception for misconfigured operations
mathisrichter Nov 4, 2021
61bffd3
Refactored validation of operations using exceptions rather than bool…
mathisrichter Nov 4, 2021
e678df6
Added Weights operation
mathisrichter Nov 4, 2021
b56a5a2
Unit test for computing weights now covers shapes of 0d-3d
mathisrichter Nov 4, 2021
2b5ec5b
Major rewrite of operations; now supporting multiple operations that …
mathisrichter Nov 6, 2021
67bd6c9
Added ReduceDims Operation
mathisrichter Nov 7, 2021
a3a1c2d
Removed redundant unit test for connect function
mathisrichter Nov 7, 2021
105de94
Added AbstractExpandDimsOperation
mathisrichter Nov 7, 2021
8dc5ed2
Added ExpandDims Operation
mathisrichter Nov 8, 2021
4d6e821
Refactored projection function to simplify interface
mathisrichter Nov 8, 2021
53e1f5e
Added Reorder Operation (wip, some redesign required)
mathisrichter Nov 8, 2021
7e6754f
Rough draft of inputs module
mathisrichter Nov 10, 2021
bd92bd2
Refactored operations, extracting the handling of shapes
mathisrichter Nov 10, 2021
578a4ed
Added acceptance tests in tests/acceptance; moved unit tests to tests…
mathisrichter Nov 10, 2021
f62f1ce
Moved operation enums into separate module
mathisrichter Nov 10, 2021
dc68507
Minor changes to docstrings
mathisrichter Nov 11, 2021
b9f68be
Added additional top-level 'src' directory and 'lava' directory under…
mathisrichter Nov 11, 2021
f8a318d
GaussInputPattern + SpikeInputGenerator + BiasInputGenerator and draf…
Nov 11, 2021
854c30a
updating .gitignore
Nov 11, 2021
16a4acb
Cosmetics on imports
mathisrichter Nov 11, 2021
af49421
Added is_odd() helper function
mathisrichter Nov 11, 2021
c657632
Added BorderType enum
mathisrichter Nov 11, 2021
9f32604
Fixed docstrings
mathisrichter Nov 11, 2021
e2f6c37
Added rudimentary Kernel class to support development of Convolution …
mathisrichter Nov 11, 2021
f66229b
Added Convolution operation
mathisrichter Nov 11, 2021
357392d
Merge remote-tracking branch 'origin/porting_core' into inputs
Nov 12, 2021
cb56490
Merge branch 'main' of https://github.com/mathisrichter/lava-dnf into…
mathisrichter Nov 12, 2021
6668899
Fixed linter warnings
mathisrichter Nov 13, 2021
68cb343
Fixed security linter error
mathisrichter Nov 14, 2021
b13b77b
GaussInputPattern + SpikeInputGenerator done. SpikeSource not running.
Nov 15, 2021
da4a048
Updated CI/CD based on lava-optimization
mathisrichter Nov 15, 2021
4804bf6
Added pybuilder dependency
mathisrichter Nov 15, 2021
56e5bbc
First draft of a DNF 101 tutorial
mathisrichter Nov 17, 2021
daaae07
Added gauss() function
mathisrichter Nov 18, 2021
af8e2db
Added SelectiveKernel
mathisrichter Nov 18, 2021
11776e2
Fixed linter error
mathisrichter Nov 18, 2021
2a2c65c
Renamed bias_mant to bias in Population
mathisrichter Nov 18, 2021
21ad7cb
Added MultiPeakKernel
mathisrichter Nov 19, 2021
15004cf
Updated example in README to new API
mathisrichter Nov 19, 2021
ed33e22
SpikeInput refactoring (wip)
Nov 19, 2021
58f4d9f
Merge remote-tracking branch 'origin/main' into inputs
Nov 19, 2021
0e293c2
GaussPattern + SpikeGenerator. Missing unit tests and documentation.
Nov 19, 2021
d29453e
Merge branch 'main' of https://github.com/mathisrichter/lava-dnf into…
mathisrichter Nov 19, 2021
2799e4b
Updated the DNF 101 tutorial
mathisrichter Nov 19, 2021
9363bf5
Reordered sections of DNF tutorial and fixed minor issues
mathisrichter Nov 19, 2021
4b03cb1
Documentation + refactor GaussPattern param validation + fixing linti…
Nov 21, 2021
03f90b5
Restructuring inputs directory
Nov 21, 2021
6401891
Unit testing.
Nov 22, 2021
5dee2fd
Temporary placeholder for missing ReshapePorts
mathisrichter Nov 22, 2021
040f45f
Adding parameters to SpikeGenerator + refactoring unit tests.
Nov 22, 2021
bd576a9
Merge pull request #1 from mathisrichter/inputs
mathisrichter Nov 22, 2021
4fdf340
Merge branch 'tutorial_dnf'
mathisrichter Nov 22, 2021
1186f84
Skipping unit tests that have non-deterministic behavior
mathisrichter Nov 22, 2021
e7de0ba
Skipping unit tests that have non-deterministic behavior
mathisrichter Nov 22, 2021
ab18ca6
Changed __init__.py files to new Lava convention
mathisrichter Nov 22, 2021
95a1c49
Removed one more __init__.py file
mathisrichter Nov 22, 2021
4ddcad0
Removed two more __init__.py files
mathisrichter Nov 23, 2021
ed12ebd
Updated tutorial after feedback
mathisrichter Nov 23, 2021
3a60860
Fixed non-determinism in unit tests (#3)
gkarray Nov 23, 2021
71379ff
Update requirements.txt (#2)
mgkwill Nov 23, 2021
f7be279
Merge branch 'main' of https://github.com/mathisrichter/lava-dnf into…
mathisrichter Nov 23, 2021
81a812a
Merge branch 'v0.1.0' of https://github.com/mathisrichter/lava-dnf in…
mathisrichter Nov 23, 2021
a752f9a
Fixed bugs in tutorial
mathisrichter Nov 23, 2021
6b4b7be
Update requirements.txt
mgkwill Nov 23, 2021
55aee00
Update build.py
mgkwill Nov 23, 2021
41ab4e3
ci-build.yml: Only run unit tests on Windows
mgkwill Nov 23, 2021
07407dd
Update ci-build.yml
mgkwill Nov 23, 2021
6541284
Moved unit tests to be consistent with lava test directory structure
mathisrichter Nov 23, 2021
95ee832
Replaced np.bool/np.int with bool/int
mathisrichter Nov 23, 2021
23c3c6e
Replaced tau parameters with decay
mathisrichter Nov 23, 2021
56b0ce2
Added complete type annotations
mathisrichter Nov 24, 2021
39e6789
Capitalized comments
mathisrichter Nov 24, 2021
4333c3b
Merge branch 'v0.1.0' of https://github.com/mathisrichter/lava-dnf in…
mathisrichter Nov 24, 2021
166dc92
Removed Population Process and replaced it with LIF
mathisrichter Nov 24, 2021
3c7ded0
Addressing pending error, RuntimeWarning and adding few comments.
Nov 24, 2021
7e149a0
Merge branch 'v0.1.0' of https://github.com/mathisrichter/lava-dnf in…
Nov 24, 2021
0127fab
Update ci-build.yml
mgkwill Nov 24, 2021
1df1101
Added preliminary but working raster plot
mathisrichter Nov 24, 2021
94e4a37
Updated tutorial to include Monitors and raster plots
mathisrichter Nov 24, 2021
b65d2f8
Merge branch 'v0.1.0' of https://github.com/mathisrichter/lava-dnf in…
mathisrichter Nov 24, 2021
1d39493
Cosmetic changes to visible documents
mathisrichter Nov 24, 2021
6067133
Updated tutorial to work with new Dense implementations
mathisrichter Nov 25, 2021
d819a27
Split off examples from DNF 101 tutorial
mathisrichter Nov 25, 2021
513fe30
Docstring cosmetics
mathisrichter Nov 25, 2021
a7bd075
Minor correction in RateCodeSpikeGen + restructure and unit testing p…
Nov 25, 2021
e263766
Merge branch 'v0.1.0' of https://github.com/mathisrichter/lava-dnf in…
Nov 25, 2021
8a29c07
Operations in connect function are now optional
mathisrichter Nov 25, 2021
25bd88e
Merge branch 'v0.1.0' of https://github.com/mathisrichter/lava-dnf in…
mathisrichter Nov 25, 2021
f067d8d
Fixed linter errors
mathisrichter Nov 25, 2021
3af9322
Homogenizing asserts in plotting's unit tests.
Nov 25, 2021
1af9605
Reverting plotting functions to old (num_time_steps, num_neurons) sha…
Nov 25, 2021
865431d
Refactoring tutorial_dnf_regimes.ipynb
Nov 25, 2021
1ad708a
Adding colorbar to tutorial_dnf_regimes.ipynb plots.
Nov 25, 2021
f5c4bf7
Updated tutorials
mathisrichter Nov 26, 2021
310549d
Adding animated plot for dnf_regimes tutorial
Nov 26, 2021
3fa2f3d
Merge branch 'v0.1.0' of https://github.com/mathisrichter/lava-dnf in…
Nov 26, 2021
d12397d
Fixing linter errors.
Nov 26, 2021
5b2fba2
Updated animated plots and added them to DNF regime tutorial
mathisrichter Nov 26, 2021
bb7441b
Fixed unit tests that needed changes but were blocked by PR #96
mathisrichter Nov 27, 2021
0468ae6
Removed tags from Process Models, anticipating changes in PR#96
mathisrichter Nov 29, 2021
9637982
Fixed typo in tutorial
mathisrichter Nov 29, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install pybuilder

- name: Run pybuilder w/o unit tests
run: |
pyb analyze

security-lint:
name: Security Lint with bandit
runs-on: ubuntu-latest
Expand All @@ -39,17 +37,15 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install pybuilder

- name: Run pybuilder to lint security w/ bandit
run: |
pyb bandit

unit-tests:
name: Run unit tests
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ubuntu-latest, windows-latest, macos-latest]
operating-system: [ubuntu-latest, macos-latest]

steps:
- uses: actions/checkout@v2
Expand All @@ -63,7 +59,7 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

pip install pybuilder
- name: Run unit tests
run: |
python -m unittest discover -s tests -p "test_*.py" -vvv
pyb -E unit
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ venv.bak/
.spyderproject
.spyproject

# vscode project settings
.vscode/

# Rope project settings
.ropeproject

Expand Down
20 changes: 6 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,29 +41,21 @@ Examples demonstrating basic DNF regimes and instabilities
- Detection of input
- Selection of input
- Working memory of input
- Neural oscillator

Infrastructure
- Sensor and data input/output
- Plotting

## Example

```python
from lava.lib.dnf.populations import Population
from lava.lib.dnf.kernels import SelectiveKernel
from lava.lib.dnf.connect import connect
from lava.lib.dnf.operations import Instar, OneToOne
from lava.proc.lif.process import LIF
from lava.lib.dnf.kernels.kernels import SelectiveKernel
from lava.lib.dnf.connect.connect import connect
from lava.lib.dnf.operations.operations import Convolution

# create population of 20x20 spiking neurons
dnf = Population(shape=(20, 20))
dnf = LIF(shape=(20, 20))

# create a selective kernel
kernel = SelectiveKernel(amp_exc=18, width_exc=[4, 4], global_inh=-15)

# apply the kernel to the population to create a DNF with a selective regime
connect(dnf, dnf, [Instar(kernel)])
connect(dnf.s_out, dnf.a_in, [Convolution(kernel)])
```



33 changes: 17 additions & 16 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@
# use_plugin("python.coverage")
use_plugin("python.distutils")
use_plugin("python.sphinx")
use_plugin('python.install_dependencies')
use_plugin("python.install_dependencies")
use_plugin("python.pycharm")
use_plugin('pypi:pybuilder_bandit')
use_plugin("pypi:pybuilder_bandit")

name = "lava-nc/lava-dnf"
name = "lava-dnf"
default_task = ["analyze", "publish"]
version = "0.1.0"
summary = "A library that provides processes and other software infrastructure to build architectures composed of Dynamic Neural Fields (DNF). This library also provides tools to direct sensory input to neural architectures and to read output, for instance for motor control. Lava-DNF is part of Lava Framework "
summary = "A library that provides processes and other software infrastructure to build architectures composed of Dynamic Neural Fields (DNF)."
url = "https://lava-nc.org"
license = ["BSD-3-Clause"]


@init
def set_properties(project):
project.set_property("dir_source_main_python", "src/lava")
project.set_property("dir_source_unittest_python", "tests")
project.set_property("dir_source_main_python", "src")
project.set_property("dir_source_unittest_python", "tests/lava")
project.set_property("dir_source_main_scripts", "scripts")
project.set_property("dir_docs", "docs")

Expand Down Expand Up @@ -53,20 +53,21 @@ def set_properties(project):
"target/*,.svn,CVS,.bzr,.hg,.git,__pycache__,.pybuilder/*",
)

project.get_property('distutils_commands').append('build')
project.get_property('distutils_commands').append('sdist')
project.get_property('distutils_commands').append('bdist_dumb')
project.get_property("distutils_commands").append("build")
project.get_property("distutils_commands").append("sdist")
project.get_property("distutils_commands").append("bdist_dumb")

project.set_property('bandit_break_build', True)
project.set_property('bandit_include_testsources', False)
project.set_property("bandit_break_build", True)
project.set_property("bandit_include_testsources", False)


@init(environments="unit")
def set_properties_unit(project):
project.set_property("dir_source_main_python", "src/lava")
project.set_property("dir_source_unittest_python", "tests")
project.set_property("dir_source_main_python", "src")
project.set_property("dir_source_unittest_python", "tests/lava")
project.set_property("dir_source_main_scripts", "scripts")
project.set_property("dir_docs", "docs")
project.build_depends_on("lava", url="git+https://github.com/lava-nc/lava.git")

project.set_property("sphinx_config_path", "docs")
project.set_property("sphinx_source_dir", "docs")
Expand All @@ -82,7 +83,7 @@ def set_properties_unit(project):
project.plugin_depends_on("sphinx_tabs")

project.set_property("verbose", True)

project.set_property("coverage_threshold_warn", 0)
project.set_property("coverage_break_build", False)

Expand All @@ -96,5 +97,5 @@ def set_properties_unit(project):

project.set_property("unittest_module_glob", "test_*")

project.set_property('bandit_break_build', True)
project.set_property('bandit_include_testsources', False)
project.set_property("bandit_break_build", True)
project.set_property("bandit_include_testsources", False)
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
lava-nc@git+https://github.com/lava-nc/lava.git
numpy
scipy>=1.7.2
11 changes: 9 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import shutil

from sys import version_info

py3 = version_info[0] == 3
py2 = not py3
if py2:
Expand All @@ -41,7 +42,9 @@

def install_pyb():
try:
subprocess.check_call([sys.executable, "-m", "pip", "install", "pybuilder"])
subprocess.check_call(
[sys.executable, "-m", "pip", "install", "pybuilder"]
)
except subprocess.CalledProcessError as e:
sys.exit(e.returncode)

Expand All @@ -64,11 +67,13 @@ def install_pyb():

try:
from pybuilder.cli import main

# verbose, debug, skip all optional...
if main("-v", "-X", "-o", "--reset-plugins", "clean", "package"):
raise RuntimeError("PyBuilder build failed")

from pybuilder.reactor import Reactor

reactor = Reactor.current_instance()
project = reactor.project
dist_dir = project.expand_path("$dir_dist")
Expand All @@ -83,7 +88,9 @@ def install_pyb():
os.remove(target_file_name)
shutil.move(src_file, script_dir)
setup_args = sys.argv[1:]
subprocess.check_call([sys.executable, "setup.py"] + setup_args, cwd=script_dir)
subprocess.check_call(
[sys.executable, "setup.py"] + setup_args, cwd=script_dir
)
except subprocess.CalledProcessError as e:
exit_code = e.returncode
sys.exit(exit_code)
1 change: 0 additions & 1 deletion src/lava/lib/dnf/README.md

This file was deleted.

Loading