Skip to content
This repository was archived by the owner on Sep 28, 2024. It is now read-only.

Commit a1752ef

Browse files
committed
test ChebyshevTransform
1 parent 0e58876 commit a1752ef

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/operator_kernel.jl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,3 +142,21 @@ end
142142
@test SpectralConv(ch, modes) isa OperatorConv
143143
@test SpectralConv(ch, modes).transform isa FourierTransform
144144
end
145+
146+
@testset "1D OperatorConv with ChebyshevTransform" begin
147+
modes = (16,)
148+
ch = 64 => 128
149+
150+
m = Chain(Dense(2, 64),
151+
OperatorConv(ch, modes, ChebyshevTransform))
152+
@test ndims(OperatorConv(ch, modes, ChebyshevTransform)) == 1
153+
@test repr(OperatorConv(ch, modes, ChebyshevTransform)) ==
154+
"OperatorConv(64 => 128, (16,), ChebyshevTransform, permuted=false)"
155+
156+
𝐱 = rand(Float32, 2, 1024, 5)
157+
@test size(m(𝐱)) == (128, 1024, 5)
158+
159+
loss(x, y) = Flux.mse(m(x), y)
160+
data = [(𝐱, rand(Float32, 128, 1024, 5))]
161+
Flux.train!(loss, Flux.params(m), data, Flux.Adam())
162+
end

0 commit comments

Comments
 (0)