Skip to content

Commit 5dcdfe4

Browse files
committed
Merge branch 'v3' of github.com:NACLab/ngc-learn into v3
2 parents 0e3f674 + ac2ec13 commit 5dcdfe4

File tree

7 files changed

+17
-16
lines changed

7 files changed

+17
-16
lines changed

ngclearn/components/base_monitor.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import json
22

3-
from ngclearn import Component, Compartment, transition
3+
from ngclearn import Component, Compartment #, transition
44
from ngclearn import numpy as np
5-
from ngcsimlib.utils import get_current_path
5+
#from ngcsimlib.utils import get_current_path
66
from ngcsimlib.logger import warn, critical
77

88
import matplotlib.pyplot as plt
@@ -68,7 +68,7 @@ def _record_internal(compartments):
6868
"monitor found in ngclearn.components or "
6969
"ngclearn.components.lava (If using lava)")
7070

71-
@transition(None, True)
71+
#@transition(None, True)
7272
@staticmethod
7373
def reset(component):
7474
"""
@@ -95,7 +95,7 @@ def _reset(**kwargs):
9595
# pure func, output compartments, args, params, input compartments
9696
return _reset, output_compartments, [], [], output_compartments
9797

98-
@transition(None, True)
98+
#@transition(None, True)
9999
@staticmethod
100100
def record(component):
101101
output_compartments = []
@@ -265,8 +265,9 @@ def load(self, directory, **kwargs):
265265

266266
for comp_path, shape in vals["stores"].items():
267267
compartment_path = comp_path.split("/")[-1]
268-
new_path = get_current_path() + "/" + "/".join(
269-
compartment_path.split("*")[-3:-1])
268+
new_path = ""
269+
# new_path = get_current_path() + "/" + "/".join(
270+
# compartment_path.split("*")[-3:-1])
270271

271272
cs, end = self._add_path(new_path)
272273

ngclearn/components/monitor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from ngclearn.components.base_monitor import Base_Monitor
2-
from ngclearn import transition
2+
#from ngclearn import transition
33

44
class Monitor(Base_Monitor):
55
"""

tests/components/input_encoders/test_bernoulliCell.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ def clamp(x):
4747
assert_array_equal(outs, x_seq)
4848
#print(outs)
4949

50-
test_bernoulliCell1()
50+
#test_bernoulliCell1()

tests/components/input_encoders/test_latencyCell.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,4 @@ def clamp(x):
6060
## output should equal input
6161
assert_array_equal(outs, targets)
6262

63-
test_latencyCell1()
63+
#test_latencyCell1()

tests/components/input_encoders/test_phasorCell.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ def clamp(x):
4444
## output should equal input
4545
assert_array_equal(outs, x_seq)
4646

47-
test_phasorCell1()
47+
#test_phasorCell1()

tests/components/input_encoders/test_poissonCell.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@ def clamp(x):
4343
## output should equal input
4444
assert_array_equal(outs, x_seq)
4545

46-
test_poissonCell1()
46+
#test_poissonCell1()

tests/components/neurons/graded/test_rewardErrorCell.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ def clamp_reward(x):
5858
reward_t = jnp.array([[reward_seq[0, ts]]]) ## get reward at time t
5959
clamp_reward(reward_t)
6060
advance_process.run(t=ts * 1., dt=dt)
61-
mu_outs.append(a.mu.value)
62-
rpe_outs.append(a.rpe.value)
63-
accum_reward_outs.append(a.accum_reward.value)
61+
mu_outs.append(a.mu.get())
62+
rpe_outs.append(a.rpe.get())
63+
accum_reward_outs.append(a.accum_reward.get())
6464

6565
# Test evolve function
6666
evolve_process.run(t=10 * 1., dt=dt)
67-
final_mu = a.mu.value
67+
final_mu = a.mu.get()
6868
# print(f"final_mu: {final_mu}")
6969

7070
mu_outs = jnp.concatenate(mu_outs, axis=1)
@@ -85,4 +85,4 @@ def clamp_reward(x):
8585
expected_final_mu = (1 - 1/10) * mu_outs[0, -1] + (1/10) * (accum_reward_outs[0, -1] / 10)
8686
np.testing.assert_allclose(final_mu, expected_final_mu, atol=1e-5)
8787

88-
# test_rewardErrorCell()
88+
#test_rewardErrorCell()

0 commit comments

Comments
 (0)