Skip to content

Commit

Permalink
Fix calculation of output_len in refine's callback wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
mstimberg committed Feb 5, 2021
1 parent b40e21e commit e46ba06
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions brian2modelfitting/fitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1322,10 +1322,9 @@ def _calc_gradient(params):
combined_errors = []
def _callback_wrapper(params, iter, resid, *args, **kwds):
# TODO: Assumes all the outputs have the same size
output_len = self.output[0].size - t_start_steps
output_len = self.output[0][:, t_start_steps:].size
error = tuple([mean(resid[idx*output_len:(idx + 1)*output_len]**2)
for idx in range(len(self.output_var))])

combined_error = sum(array(error))
errors.append(error)
combined_errors.append(combined_error)
Expand Down

0 comments on commit e46ba06

Please sign in to comment.