Skip to content

Commit 4dcb907

Browse files
Merge pull request #742 from Abhishek-1Bhatt/activation
Lux.ActivationFunction not required
2 parents 1057063 + f2ed332 commit 4dcb907

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

docs/src/examples/GPUs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ If one is using `Lux.Chain`, then the computation takes place on the GPU with
3737
```julia
3838
import Lux
3939

40-
dudt2 = Lux.Chain(Lux.ActivationFunction(x -> x^3),
40+
dudt2 = Lux.Chain(x -> x.^3,
4141
Lux.Dense(2,50,tanh),
4242
Lux.Dense(50,2))
4343

docs/src/examples/collocation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ savefig("colloc.png")
3131
plot(tsteps,du')
3232
savefig("colloc_du.png")
3333
34-
dudt2 = Lux.Chain(ActivationFunction(x -> x^3),
34+
dudt2 = Lux.Chain(x -> x.^3,
3535
Lux.Dense(2, 50, tanh),
3636
Lux.Dense(50, 2))
3737
@@ -134,7 +134,7 @@ calculates the squared difference between `f(u,p,t)` and `u'` at each
134134
point, and find the parameters which minimize this difference:
135135

136136
```@example collocation
137-
dudt2 = Lux.Chain(ActivationFunction(x -> x^3),
137+
dudt2 = Lux.Chain(x -> x.^3,
138138
Lux.Dense(2, 50, tanh),
139139
Lux.Dense(50, 2))
140140

docs/src/examples/multiple_shooting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ ode_data = Array(solve(prob_trueode, Tsit5(), saveat = tsteps))
4141

4242

4343
# Define the Neural Network
44-
nn = Lux.Chain(ActivationFunction(x -> x^3),
44+
nn = Lux.Chain(x -> x.^3,
4545
Lux.Dense(2, 16, tanh),
4646
Lux.Dense(16, 2))
4747
p_init, st = Lux.setup(rng, nn)

docs/src/examples/neural_ode.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ end
2828
prob_trueode = ODEProblem(trueODEfunc, u0, tspan)
2929
ode_data = Array(solve(prob_trueode, Tsit5(), saveat = tsteps))
3030
31-
dudt2 = Lux.Chain(ActivationFunction(x -> x^3),
31+
dudt2 = Lux.Chain(x -> x.^3,
3232
Lux.Dense(2, 50, tanh),
3333
Lux.Dense(50, 2))
3434
p, st = Lux.setup(rng, dudt2)
@@ -110,7 +110,7 @@ the layer. Here we're going to use `Lux.Chain`, which is a suitable neural netwo
110110
structure for NeuralODEs with separate handling of state variables:
111111

112112
```@example neuralode
113-
dudt2 = Lux.Chain(ActivationFunction(x -> x^3),
113+
dudt2 = Lux.Chain(x -> x.^3,
114114
Lux.Dense(2, 50, tanh),
115115
Lux.Dense(50, 2))
116116
p, st = Lux.setup(rng, dudt2)

0 commit comments

Comments
 (0)