Skip to content

Commit b2a1738

Browse files
Don't use DiffEqFlux in the example
1 parent e33c9e4 commit b2a1738

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

docs/src/tutorials/minibatch.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
for details on the installation and usage.
77

88
```julia
9-
using DiffEqFlux, Optimization, OptimizationOptimisers, OrdinaryDiffEq
9+
using Flux, Optimization, OptimizationOptimisers, OrdinaryDiffEq
1010

1111
function newtons_cooling(du, u, p, t)
1212
temp = u[1]
@@ -19,8 +19,11 @@ function true_sol(du, u, p, t)
1919
newtons_cooling(du, u, true_p, t)
2020
end
2121

22+
ann = Chain(FastDense(1,8,tanh), FastDense(8,1,tanh))
23+
pp,re = Flux.destructure(ann)
24+
2225
function dudt_(u,p,t)
23-
ann(u, p).* u
26+
re(p)(u) .* u
2427
end
2528

2629
callback = function (p,l,pred;doplot=false) #callback function to observe training
@@ -42,8 +45,6 @@ t = range(tspan[1], tspan[2], length=datasize)
4245
true_prob = ODEProblem(true_sol, u0, tspan)
4346
ode_data = Array(solve(true_prob, Tsit5(), saveat=t))
4447

45-
ann = FastChain(FastDense(1,8,tanh), FastDense(8,1,tanh))
46-
pp = initial_params(ann)
4748
prob = ODEProblem{false}(dudt_, u0, tspan, pp)
4849

4950
function predict_adjoint(fullp, time_batch)

0 commit comments

Comments
 (0)