Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Minibatching throughDataLoader with OptimisationOptimJL.AbstractOptimizer is broken #873

Open
vboussange opened this issue Jan 16, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@vboussange
Copy link

using Optimization, OptimizationOptimJL, OptimizationOptimisers

data = randn(2, 100)
idx_ranges = 1:size(data, 2)

loss(x, idx_rngs) = sum(abs2, data[:, idx_rngs] .- x)
objectivefun = OptimizationFunction(loss, Optimization.AutoForwardDiff())

x0 = [1.0, 1.0]
train_loader = DataLoader(idx_ranges; batchsize = 2, shuffle = true, partial=true)
optprob = OptimizationProblem(objectivefun, x0, train_loader)

# passes
opt = OptimizationOptimisers.Adam()
Optimization.solve(optprob,
                    opt,
                    maxiters=100)

# breaks
opt = OptimizationOptimJL.Adam()
Optimization.solve(optprob,
                    opt,
                    maxiters=100)
@vboussange vboussange added the bug Something isn't working label Jan 16, 2025
@vboussange vboussange changed the title Minibatching throughDataLoader with OptimisationOptimJL.AbstractOptimizer is broken Minibatching throughDataLoader with OptimisationOptimJL.AbstractOptimizer is broken Jan 16, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant