Skip to content

Commit b2daa94

Browse files
committed
Merge branch 'feat/gru' of https://github.com/PrincetonUniversity/PsyNeuLink into feat/gru
2 parents cc9ea98 + 7f88327 commit b2daa94

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

psyneulink/library/compositions/compositionrunner.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -360,10 +360,14 @@ def run_learning(self,
360360
skip_initialization = True
361361

362362
if execution_mode is ExecutionMode.PyTorch:
363-
pytorch_rep = (self._composition.parameters.pytorch_representation._get(context).
364-
copy_weights_to_psyneulink(context))
363+
# MODIFIED 2/16/25 OLD:
364+
# pytorch_rep = (self._composition.parameters.pytorch_representation._get(context).
365+
# copy_weights_to_psyneulink(context))
366+
# MODIFIED 2/16/25 NEW:
367+
pytorch_rep = self._composition.parameters.pytorch_representation._get(context)
365368
if pytorch_rep and synch_with_pnl_options[MATRIX_WEIGHTS] == MINIBATCH:
366369
pytorch_rep.copy_weights_to_psyneulink(context)
370+
# MODIFIED 2/16/25 END
367371

368372
num_epoch_results = num_trials // minibatch_size # number of results expected from final epoch
369373
# return self._composition.parameters.results.get(context)[-1 * num_epoch_results:]

tests/composition/test_grucomposition.py

-1
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,3 @@ def test_pytorch_learning_identicality(self, bias):
9393

9494
# np.testing.assert_allclose(torch_result_before_learning.detach().numpy(), pnl_result_before_learning, atol=1e-6)
9595
np.testing.assert_allclose(torch_result_after_learning.detach().numpy(), pnl_result_after_learning, atol=1e-6)
96-

0 commit comments

Comments
 (0)