Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
Vaibhavdixit02 committed Sep 26, 2024
1 parent 36ecbd1 commit 4fd3cae
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# v4 Breaking changes

The main change in this breaking release has been the way mini-batching is handled. The data argument in the solve call and the implicit iteration of that in the callback has been removed,
the stochastic solvers (Optimisers.jl and Sophia) now handle it explicitly. You would now pass in a DataLoader to OptimziationProblem as the second argument to the objective etc (p) if you
The main change in this breaking release has been the way mini-batching is handled. The data argument in the solve call and the implicit iteration of that in the callback has been removed,
the stochastic solvers (Optimisers.jl and Sophia) now handle it explicitly. You would now pass in a DataLoader to OptimziationProblem as the second argument to the objective etc (p) if you

Check warning on line 4 in NEWS.md

View workflow job for this annotation

GitHub Actions / Spell Check with Typos

"Optimziation" should be "Optimization".
want to do minibatching, else for full batch just pass in the full data.
3 changes: 2 additions & 1 deletion lib/OptimizationOptimisers/src/OptimizationOptimisers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ function SciMLBase.__solve(cache::OptimizationCache{
cache.f.grad(G, θ)
x = cache.f(θ)
end
opt_state = Optimization.OptimizationState(iter = i + (epoch-1)*length(data),
opt_state = Optimization.OptimizationState(
iter = i + (epoch - 1) * length(data),
u = θ,
objective = x[1],
grad = G,
Expand Down
3 changes: 2 additions & 1 deletion lib/OptimizationOptimisers/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ using Zygote
end

@testset "Minibatching" begin
using Optimization, OptimizationOptimisers, Lux, Zygote, MLUtils, Random, ComponentArrays
using Optimization, OptimizationOptimisers, Lux, Zygote, MLUtils, Random,
ComponentArrays

x = rand(10000)
y = sin.(x)
Expand Down

0 comments on commit 4fd3cae

Please sign in to comment.