Skip to content
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

More intuitive interface for batch computation #16

Open
shinaoka opened this issue Jun 18, 2024 · 2 comments
Open

More intuitive interface for batch computation #16

shinaoka opened this issue Jun 18, 2024 · 2 comments

Comments

@shinaoka
Copy link
Member

shinaoka commented Jun 18, 2024

Based on feedback from my students, the current interface based on inheritance is not intuitive.
How about adding a new keyword parameter batchedfunc to optimize! and crossinterpolate and so on?
This is similar to scipy optimizer interface, where we can pass a function computing derivative, with jac.

@rittermarc
What do you think?

@rittermarc
Copy link
Member

Is your proposal to just add a boolean batchedfunc, in which case the function will receive sets of indices instead of being evaluated on each element?

I agree that the current interface is not very intuitive, but I'm not sure how much of an improvement this would be.

@shinaoka
Copy link
Member Author

If your function f object supports both:

crossinterpolate2(Float64, f, ....; batchedfunc=f, ....)

If you have two distinct functions:

crossinterpolate2(Float64, f, ....; batchedfunc=f2, ....)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants