-
Notifications
You must be signed in to change notification settings - Fork 18
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
frozen distribution considerably slower #532
Comments
I think the way to go is to try and avoid using So where we would currently do: distrib = self.expr_fit.evaluate(x, self.data_pred)
support = distrib.support() We would define: class Expression:
...
def support(self, coefficients_values, inputs_values):
params = self.get_params(coefficients_values, inputs_values)
return self.distrib().support(**params) and can then use: support = self.expr_fit.support(x, self.data_pred) Important This is secondary stuff
|
I just saw that I did not mention that
Of course |
Expression.evaluate(...)
creates a frozen scipy distribution (frozen means that the params, e.g.loc
are fixed). Using a frozen instance instead of a non-frozen one is considerably slower. It's the setup of the frozen instance which is costly and takes about 501 μs (on my laptop). So if we create one instance and call it repeatedly this does not matter much, but if we set it up every time it adds up. The setup time seems relatively independent of the number of elements.This could also offer some speed ups - especially in optimization routines - but will require a change in how the functions are called.
The text was updated successfully, but these errors were encountered: