Skip to content

Commit

Permalink
Remove upper pin on PNL, add lower pin.
Browse files Browse the repository at this point in the history
Fix stroop example to use input_shapes in place of size.
  • Loading branch information
davidt0x committed Jan 8, 2025
1 parent acc49ba commit 601690d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions examples/PsyNeuLink/stroop_conflict_monitoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

# Construct the color naming pathway:
color_input = pnl.ProcessingMechanism(
name="color_input", size=2
name="color_input", input_shapes=2
) # Note: default function is Linear
color_input_to_hidden_wts = np.array([[2, -2], [-2, 2]])
color_hidden = pnl.ProcessingMechanism(
name="color_hidden", size=2, function=pnl.Logistic(bias=-4)
name="color_hidden", input_shapes=2, function=pnl.Logistic(bias=-4)
)
color_hidden_to_output_wts = np.array([[2, -2], [-2, 2]])
output = pnl.ProcessingMechanism(name="OUTPUT", size=2, function=pnl.Logistic)
output = pnl.ProcessingMechanism(name="OUTPUT", input_shapes=2, function=pnl.Logistic)
color_pathway = [
color_input,
color_input_to_hidden_wts,
Expand All @@ -22,10 +22,10 @@
]

# Construct the word reading pathway (using the same output_layer)
word_input = pnl.ProcessingMechanism(name="word_input", size=2)
word_input = pnl.ProcessingMechanism(name="word_input", input_shapes=2)
word_input_to_hidden_wts = np.array([[3, -3], [-3, 3]])
word_hidden = pnl.ProcessingMechanism(
name="word_hidden", size=2, function=pnl.Logistic(bias=-4)
name="word_hidden", input_shapes=2, function=pnl.Logistic(bias=-4)
)
word_hidden_to_output_wts = np.array([[3, -3], [-3, 3]])
word_pathway = [
Expand All @@ -37,8 +37,8 @@
]

# Construct the task specification pathways
task_input = pnl.ProcessingMechanism(name="task_input", size=2)
task = pnl.LCAMechanism(name="TASK", size=2, initial_value=[0.5, 0.5])
task_input = pnl.ProcessingMechanism(name="task_input", input_shapes=2)
task = pnl.LCAMechanism(name="TASK", input_shapes=2, initial_value=[0.5, 0.5])
task_color_wts = np.array([[4, 4], [0, 0]])
task_word_wts = np.array([[0, 0], [4, 4]])
task_color_pathway = [task_input, task, task_color_wts, color_hidden]
Expand All @@ -53,7 +53,7 @@
name="CONTROL",
objective_mechanism=pnl.ObjectiveMechanism(
name="Conflict Monitor",
function=pnl.Energy(size=2, matrix=[[0, -2.5], [-2.5, 0]]),
function=pnl.Energy(input_shapes=2, matrix=[[0, -2.5], [-2.5, 0]]),
monitor=output,
),
default_allocation=[0.5],
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ package_dir =

[options.extras_require]
psyneulink =
psyneulink<=0.15.1.0
psyneulink>=0.15.3

neuroml =
pyNeuroML>=1.0.10
Expand Down

0 comments on commit 601690d

Please sign in to comment.