Skip to content

Commit 4fd3cae

Browse files
format
1 parent 36ecbd1 commit 4fd3cae

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

NEWS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# v4 Breaking changes
22

3-
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,
4-
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
3+
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,
4+
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
55
want to do minibatching, else for full batch just pass in the full data.

lib/OptimizationOptimisers/src/OptimizationOptimisers.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ function SciMLBase.__solve(cache::OptimizationCache{
9393
cache.f.grad(G, θ)
9494
x = cache.f(θ)
9595
end
96-
opt_state = Optimization.OptimizationState(iter = i + (epoch-1)*length(data),
96+
opt_state = Optimization.OptimizationState(
97+
iter = i + (epoch - 1) * length(data),
9798
u = θ,
9899
objective = x[1],
99100
grad = G,

lib/OptimizationOptimisers/test/runtests.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ using Zygote
7070
end
7171

7272
@testset "Minibatching" begin
73-
using Optimization, OptimizationOptimisers, Lux, Zygote, MLUtils, Random, ComponentArrays
73+
using Optimization, OptimizationOptimisers, Lux, Zygote, MLUtils, Random,
74+
ComponentArrays
7475

7576
x = rand(10000)
7677
y = sin.(x)

0 commit comments

Comments
 (0)