Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
SCiarella committed Nov 20, 2024
1 parent 703902c commit c5d766b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- main
tags: ["*"]
#tags: ["*"] #uncomment the line if you want to run the workflow only when a new tag is pushed
workflow_dispatch:

jobs:
Expand Down
35 changes: 17 additions & 18 deletions test/test-model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,29 @@ using Zygote: Zygote
# Define parameters for the model
T = Float32
D = 2
N = 32 # Define the spatial dimension for the attention layer input
emb_size = 16
N = 16 # Define the spatial dimension for the attention layer input
emb_size = 8
patch_size = 4
n_heads = 2
d = emb_size ÷ n_heads # Dimension per attention head
rng = Xoshiro(123)

# Test CNN Layer Setup
r =
[3, 3], c =
[2, 2], σ =
[tanh, identity], b =
[false, false], CnnLayers = (
(
Lux.Conv(
ntuple-> 2r[i] + 1, D),
c[i] => c[i+1],
σ[i];
use_bias = b[i],
init_weight = glorot_uniform_T,
pad = (ntuple-> 2r[i] + 1, D) .- 1) 2,
) for i in eachindex(r)
)...,
)
r = [3]
c = [4, 2]
σ = [tanh]
b = [false]
CnnLayers = (
(
Lux.Conv(
ntuple-> 2r[i] + 1, D),
c[i] => c[i+1],
σ[i];
use_bias = b[i],
pad = (ntuple-> 2r[i] + 1, D) .- 1) 2,
) for i in eachindex(r)
)...,
)

# Verify CNN layers' setup
@test CnnLayers != nothing
Expand Down

0 comments on commit c5d766b

Please sign in to comment.