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

Compiler graph: Enable model selection, fixing warning in QUBO tutorial #418

Merged
merged 5 commits into from
Oct 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 3 additions & 1 deletion src/lava/magma/compiler/compiler_graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,9 @@ def _find_proc_models_in_module(proc: AbstractProcess,
"""

proc_models = []
for name, cls in module.__dict__.items():
classes = [m[1] for m in inspect.getmembers(module, inspect.isclass)
if m[1].__module__ == module.__name__]
for cls in classes:
if (
hasattr(cls, "implements_process")
and issubclass(cls, AbstractProcessModel)
Expand Down
2 changes: 1 addition & 1 deletion tests/lava/proc/lif/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ def test_float_model(self):
v_logger.connect_var(lif_reset.v)

lif_reset.run(condition=RunSteps(num_steps),
run_cfg=Loihi2SimCfg())
run_cfg=Loihi2SimCfg(select_tag="floating_pt"))
u = u_logger.data.get()
v = v_logger.data.get()
lif_reset.stop()
Expand Down
6 changes: 3 additions & 3 deletions tests/lava/proc/monitor/test_monitors.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def test_monitor_collects_voltage_and_spike_data_from_lif_neuron(self):
bias_mant=1)

rcnd = RunSteps(num_steps=num_steps)
rcfg = Loihi1SimCfg()
rcfg = Loihi1SimCfg(select_tag="floating_pt")

# Probe voltage of LIF with the first monitor
monitor1.probe(target=neuron.v, num_steps=num_steps)
Expand Down Expand Up @@ -259,7 +259,7 @@ def test_monitor_collects_voltage_and_spike_data_from_population_lif(self):

# Run all connected processes
neuron.run(condition=RunSteps(num_steps=num_steps),
run_cfg=Loihi1SimCfg())
run_cfg=Loihi1SimCfg(select_tag="floating_pt"))

# Get data from both monitor
data1 = monitor1.get_data()
Expand Down Expand Up @@ -304,7 +304,7 @@ def test_monitor_collects_data_from_2D_population_lif(self):

# Run all connected processes
neuron.run(condition=RunSteps(num_steps=num_steps),
run_cfg=Loihi1SimCfg())
run_cfg=Loihi1SimCfg(select_tag="floating_pt"))

# Get data from both monitor
data1 = monitor1.get_data()
Expand Down
16 changes: 8 additions & 8 deletions tutorials/end_to_end/tutorial00_tour_through_lava.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@
{
"data": {
"text/plain": [
"\u001b[0;31mInit signature:\u001b[0m \u001b[0mLIF\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mDocstring:\u001b[0m \n",
"\u001B[0;31mInit signature:\u001B[0m \u001B[0mLIF\u001B[0m\u001B[0;34m(\u001B[0m\u001B[0;34m*\u001B[0m\u001B[0margs\u001B[0m\u001B[0;34m,\u001B[0m \u001B[0;34m**\u001B[0m\u001B[0mkwargs\u001B[0m\u001B[0;34m)\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0m\n",
"\u001B[0;31mDocstring:\u001B[0m \n",
"Leaky-Integrate-and-Fire (LIF) neural Process.\n",
"\n",
"LIF dynamics abstracts to:\n",
Expand Down Expand Up @@ -107,10 +107,10 @@
">>> lif = LIF(shape=(200, 15), du=10, dv=5)\n",
"This will create 200x15 LIF neurons that all have the same current decay\n",
"of 10 and voltage decay of 5.\n",
"\u001b[0;31mInit docstring:\u001b[0m Initializes a new Process.\n",
"\u001b[0;31mFile:\u001b[0m ~/lava-nc/lava/src/lava/proc/lif/process.py\n",
"\u001b[0;31mType:\u001b[0m ProcessPostInitCaller\n",
"\u001b[0;31mSubclasses:\u001b[0m LIFReset\n"
"\u001B[0;31mInit docstring:\u001B[0m Initializes a new Process.\n",
"\u001B[0;31mFile:\u001B[0m ~/lava-nc/lava/src/lava/proc/lif/process.py\n",
"\u001B[0;31mType:\u001B[0m ProcessPostInitCaller\n",
"\u001B[0;31mSubclasses:\u001B[0m LIFReset\n"
]
},
"metadata": {},
Expand Down Expand Up @@ -530,7 +530,7 @@
"source": [
"from lava.magma.core.run_configs import Loihi1SimCfg\n",
"\n",
"run_cfg = Loihi1SimCfg()"
"run_cfg = Loihi1SimCfg(select_tag=\"floating_pt\")"
]
},
{
Expand Down Expand Up @@ -1032,4 +1032,4 @@
},
"nbformat": 4,
"nbformat_minor": 5
}
}