Skip to content

Commit

Permalink
Corrected brute2fine
Browse files Browse the repository at this point in the history
  • Loading branch information
demianw committed Feb 2, 2018
1 parent 9a9eb84 commit a9c2ac0
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions dmipy/optimizers/brute2fine.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,14 +339,6 @@ def normalized_to_nested_fractions_array(normalized_fractions):
return nested_fractions


def find_minimum_argument(data_grid, signal):
"""
Finds the index in the simulated data_grid that has the lowest sum-squared
error to the signal.
"""
return np.argmin(np.sum((data_grid - signal) ** 2, axis=-1))


if have_numba:
@numba.njit()
def find_minimum_argument(data_grid, signal):
Expand All @@ -355,3 +347,10 @@ def find_minimum_argument(data_grid, signal):
diff = data_grid[i] - signal
cost[i] = np.dot(diff, diff)
return np.argmin(cost)
else:
def find_minimum_argument(data_grid, signal):
"""
Finds the index in the simulated data_grid that has the
lowest sum-squared error to the signal.
"""
return np.argmin(np.sum((data_grid - signal) ** 2, axis=-1))

1 comment on commit a9c2ac0

@rutgerfick
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah that's good to know for next time!

Please sign in to comment.