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

[skip ci] #2770

Merged
merged 3 commits into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -198,3 +198,4 @@ tests/*.pdf

/tests/mdf/*.json
/tests/mdf/*.yml
/Scripts/ScratchPad FIGURES/
Original file line number Diff line number Diff line change
Expand Up @@ -1457,7 +1457,7 @@ def derivative(self, input=None, output=None, covariates=None, context=None):
else:
jacobian = np.prod(np.vstack(covariates), axis=0) * self._get_current_parameter_value(SCALE, context)

return np.eye(len(output)) * (output * jacobian)
return np.eye(len(output)) * jacobian

def _get_input_struct_type(self, ctx):
# FIXME: Workaround a special case of simple array.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2579,7 +2579,7 @@ def _function(self,
elif loss_spec == Loss.SSE:
dE_dA = np.dot(error_matrix, self._get_current_parameter_value(ERROR_SIGNAL, context)) * 2
else:
# Use L0 (this applies to hidden layers)
# Use L0 (this applies to hidden layers) (Jacobian vector product)
dE_dA = np.dot(error_matrix, self._get_current_parameter_value(ERROR_SIGNAL, context))

# Derivative of the output activity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3173,7 +3173,9 @@ def _function(self,
previous_value = self.parameters.previous_value._get(context)

try:
drift = np.full(dimension - 1, variable)
variable = variable.flatten()
drift = variable if len(variable) == dimension - 1 else np.full(dimension - 1, variable)

except ValueError:
owner_str = f"'of '{self.owner.name}" if self.owner else ""
raise FunctionError(f"Length of 'variable' for {self.name}{owner_str} ({len(variable)}) must be "
Expand Down