Skip to content

Commit

Permalink
Update to lambda functions
Browse files Browse the repository at this point in the history
Co-authored-by: Brady Planden <[email protected]>
  • Loading branch information
NicolaCourtier and BradyPlanden authored May 17, 2024
1 parent e2ae1dd commit aa73bff
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions pybop/optimisers/base_optimiser.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,9 @@ def _run(self):

# Choose method to evaluate
if self._needs_sensitivities:

def f(x):
return self.cost.evaluateS1(x, minimising=self._minimising)
f = lambda x: self.cost.evaluateS1(x, minimising=self._minimising)
else:

def f(x, grad=None):
return self.cost(x, grad, minimising=self._minimising)
f = lambda x, grad=None: self.cost(x, grad, minimising=self._minimising)

# Create evaluator object
if self._parallel:
Expand Down

0 comments on commit aa73bff

Please sign in to comment.