You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
defsympy_to_scipy(func, vars, params):
""" Convert a symbolic expression to one scipy digs. :param func: sympy expression :param vars: variables :param params: parameters """lambda_func=sympy_to_py(func, vars, params)
deff(x, p):
""" Scipy style function. :param x: list of arrays, NxM :param p: tuple of parameter values. """x=np.atleast_2d(x)
y= [x[i] foriinrange(len(x))]
returnlambda_func(*(y+list(p)))
returnf
The current definition of f will do the list comprehension every time it is called, which can be a lot of a lot of iterations are needed for the fit to converge. Therefore a more efficient function is desirable.
The text was updated successfully, but these errors were encountered:
tBuLi
changed the title
sympy_to_scipy More efficient
sympy_to_scipy More efficient
Dec 17, 2014
tBuLi
changed the title
sympy_to_scipy More efficient
Make sympy_to_scipy More efficient
Dec 17, 2014
The current definition of
f
will do the list comprehension every time it is called, which can be a lot of a lot of iterations are needed for the fit to converge. Therefore a more efficient function is desirable.The text was updated successfully, but these errors were encountered: