Skip to content

Commit

Permalink
Fix default_variable bug (#767)
Browse files Browse the repository at this point in the history
  • Loading branch information
dcw3 authored Apr 30, 2018
1 parent 4f2ce2f commit 5d4004a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions psyneulink/library/mechanisms/processing/leabramechanism.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,17 @@ def __init__(self,
raise LeabraError('leabra python module is not installed. Please install it from '
'https://github.com/benureau/leabra')

if network is None:
raise LeabraError('network was None. Cannot create function for Leabra Mechanism if network is not specified.')

# Assign args to params and functionParams dicts (kwConstants must == arg names)
params = self._assign_args_to_param_dicts(network=network,
params=params)

if default_variable is None:
input_size = len(self.network.layers[0].units)
default_variable = np.zeros(input_size)
output_size = len(self.network.layers[-1].units)
default_variable = [np.zeros(input_size), np.zeros(output_size)]

super().__init__(default_variable=default_variable,
params=params,
Expand Down Expand Up @@ -517,7 +521,7 @@ def _execute(
variable=variable,
function_variable=function_variable,
runtime_params=runtime_params,
ignore_execution_id=ignore_execution_id,
# ignore_execution_id=ignore_execution_id,
context=context
)

Expand Down

0 comments on commit 5d4004a

Please sign in to comment.