I tried to create a struct that has just one Conv layer.
struct Conv1D2
conv1::Conv
function Conv1D2(input_len::Int, output_len::Int)
conv1 = Conv((1, 3), input_len=>output_len)
new(conv1)
end
end
and then create the function
function (co::Conv1D2)(mat::A) where A<:AbstractArray
x,y,z = size(mat)
resized = reshape(mat, (x,y,z, 1))
cap = co.conv1(resized)
cap = reshape(mat, (x,y,z))
return cap
end
Apparently, something is wrong. While initialising a dummy value of
con = Conv1D(5,32)
I couldnt call the Conv1D function as the “con” said it was just the Conv layer.
What did i do wrong? Can someone help me?