Skip to content

Commit

Permalink
Fix name conflict between Flux and Lux in test
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergio Sánchez Ramírez committed Jul 3, 2024
1 parent bf5f6ee commit 3981380
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/nn_lux.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ noisy = rand(Float32, 2, 1000) # 2×1000
truth = [xor(col[1] > 0.5, col[2] > 0.5) for col in eachcol(noisy)] # 1000-element Vector{Bool}

# Define our model, a multi-layer perceptron with one hidden layer of size 3:
model = Chain(
Dense(2 => 3, tanh), # activation function inside layer
Dense(3 => 2),
model = Lux.Chain(
Lux.Dense(2 => 3, tanh), # activation function inside layer
Lux.Dense(3 => 2),
softmax,
)
ps, st = Lux.setup(Xoshiro(123), model)
Expand Down Expand Up @@ -43,7 +43,7 @@ ctarget = Reactant.ConcreteRArray(Array{Float32}(target))
loader = DataLoader((noisy, target); batchsize=64, shuffle=true);
# # 16-element DataLoader with first element: (2×64 Matrix{Float32}, 2×64 OneHotMatrix)

opt = Adam(0.01f0)
opt = Optimisers.Adam(0.01f0)
losses = []

# Lux.Exprimental.TrainState is very specialized for Lux models, so we write out the
Expand Down

0 comments on commit 3981380

Please sign in to comment.