-
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
Stochastic FW: optional batched user-provided functions #40
Comments
good question - i would say we leave as is for now. the reason is that we need to thing how to best map e.g., variance-reduced methods as they need special batch sizes depending on the iteration. |
OK yes. Even with the alternative version, each iteration can control the batch size by picking the size of the |
ok i will need some extra explanation tomorrow to discuss. |
So for now at the FW function level we have this: compute_gradient(f, x, rng=rng, batch_size=batch_size) At the rand_indices = if full_evaluation
eachindex(f.xs)
else
rand(rng, eachindex(f.xs), batch_size)
end
return sum(f.grad(θ, f.xs[idx]) for idx in rand_indices) So |
With the current SFW interface, users provide a function that processes one data point, batching happens a level higher when we call the provided functions.
One possibility would be to make users provide batched functions by default:
What they provide now is the equivalent of the functions
f
andg
above.The text was updated successfully, but these errors were encountered: