Skip to content

Commit

Permalink
test learning rule probing
Browse files Browse the repository at this point in the history
  • Loading branch information
neworderofjamie committed Dec 17, 2015
1 parent 9bcff4e commit 016aa07
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion tests/builder/test_ensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,28 @@ def test_refractory_time(self):
model.build(net)

# Assert that we added the probe to the list of local probes and
# nothing else
# nothing elseobject_operators
assert model.object_operators[a].local_probes == [p]
assert len(model.object_operators) == 1
assert len(model.connections_signals) == 0

class TestProbeLearningRules(object):
"""Test probing of Voja learnt encoders."""
def test_probe_voja_scaled_encoders(self):
# Create a network and standard model
with nengo.Network() as net:
a = nengo.Ensemble(100, 2)
b = nengo.Ensemble(100, 2)

a_b = nengo.Connection(a, b)
a_b.learning_rule_type = nengo.Voja()
p = nengo.Probe(a_b.learning_rule, "scaled_encoders")

# Create an empty model to build the probe into
model = builder.Model()
model.build(net)

# Assert that we added the probe to the list of local probes and
# nothing else
assert model.object_operators[b].local_probes == [p]
assert len(model.object_operators) == 2

0 comments on commit 016aa07

Please sign in to comment.