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

Removed special characters #1029

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
54 changes: 27 additions & 27 deletions nengo_gui/examples/hbb_tutorials/chapter3/1-addition.py
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
# Addition

# In this model, you will see a transformation which is the basic property of
# single neurons (i.e., addition). Addition transforms two inputs into a single
# output which is their sum. You will construct a network that adds two inputs.
# The network utilizes two communication channels going into the same neural
# population. Addition is somewhat free, since the incoming currents from
# In this model, you will see a transformation which is the basic property of
# single neurons (i.e., addition). Addition transforms two inputs into a single
# output which is their sum. You will construct a network that adds two inputs.
# The network utilizes two communication channels going into the same neural
# population. Addition is somewhat 'free', since the incoming currents from
# different synaptic connections interact linearly.

# This model has ensembles A and B which represent the two inputs to be added.
# The 'Sum' ensemble represents the added value. All the parameters used in the
# model are as described in the book, with the sum ensemble having a radius of
# This model has ensembles A and B which represent the two inputs to be added.
# The 'Sum' ensemble represents the added value. All the parameters used in the
# model are as described in the book, with the sum ensemble having a radius of
# 2 to account for the maximum range of summing the input values.

# While connecting the inputs to the ensembles A and B, the transform is
# set to 1 (which is the default value) since this should be a communication
# channel. However as described in the book, you can scale a represented
# variable by a constant value by changing the transform. Example: if you
# set the transform of ensemble B to 0 and ensemble A to 2
# (i.e., nengo.Connection(input_A, A, transform=[2]) ), the sum will be twice
# of the input_A. You will also need to set an appropriate radius for the
# Sum ensemble to avoid saturation when you change the transform values.
# While connecting the inputs to the ensembles A and B, the transform is
# set to 1 (which is the default value) since this should be a communication
# channel. However as described in the book, you can scale a represented
# variable by a constant value by changing the transform. Example: if you
# set the transform of ensemble B to 0 and ensemble A to 2
# (i.e., nengo.Connection(input_A, A, transform=[2]) ), the sum will be twice
# of the input_A. You will also need to set an appropriate radius for the
# Sum ensemble to avoid saturation when you change the transform values.

# Press the play button to run the simulation.
# The input_A and input_B graphs show the inputs to ensembles A and B
# respectively. The graphs A and B show the decoded value of the activity of
# ensembles A and B respectively. The sum graph shows that the decoded value of
# The input_A and input_B graphs show the inputs to ensembles A and B
# respectively. The graphs A and B show the decoded value of the activity of
# ensembles A and B respectively. The sum graph shows that the decoded value of
# the activity in the Sum ensemble provides a good estimate of the sum of inputs
# A and B. You can use the sliders to change the input values provided by the
# A and B. You can use the sliders to change the input values provided by the
# input_A and input_B nodes.


Expand All @@ -39,23 +39,23 @@
model = nengo.Network(label='Scalar Addition')

with model:
#Inputs to drive the activity in ensembles A and B
#Inputs to drive the activity in ensembles A and B
input_A = nengo.Node(Piecewise({0: -0.75, 1.25: 0.5, 2.5: 0.70, 3.75: 0}))
input_B = nengo.Node(Piecewise({0: 0.25, 1.25: -0.5, 2.5: 0.85, 3.75: 0}))

#Ensembles with 100 LIF neurons each
# Represents the first input
A = nengo.Ensemble(100, dimensions=1, max_rates=Uniform(100, 200))
A = nengo.Ensemble(100, dimensions=1, max_rates=Uniform(100, 200))
# Represents the second input
B = nengo.Ensemble(100, dimensions=1, max_rates=Uniform(100, 200))
B = nengo.Ensemble(100, dimensions=1, max_rates=Uniform(100, 200))
# Reprsents the sum of two inputs
Sum = nengo.Ensemble(100, dimensions=1, max_rates=Uniform(100, 200),
radius=2)
Sum = nengo.Ensemble(100, dimensions=1, max_rates=Uniform(100, 200),
radius=2)

#Connecting the input nodes to ensembles
nengo.Connection(input_A, A)
nengo.Connection(input_B, B)

#Connecting ensembles A and B to the Sum ensemble
nengo.Connection(A, Sum)
nengo.Connection(B, Sum)