Hi!
I have 1D data which I can successfully train and test with all to all connected 3 layer model as below:
function build_model_ffn(; nclasses=2)
return Chain(
Dense(99, 48, relu),
Dense(48, 24, relu),
Dense(24, 12, relu),
Dense(12, nclasses))
end
I am currently trying to adapt the 1D data to CNN by converting it into a (33, 3, 1) with 1 channel (reshaping the input data), using the following model for training:
function build_model_dnn(; nclasses=2)
return Chain(
Conv((3,3), 1=>1, relu, pad=(1,1)),
MaxPool((3,3)),
flatten,
Dense(11, 5, relu),
Dense(5, nclasses)
)
end
The core functionality of training and testing is adapted from the model zoo feed forward example and remains the same for both the above models. While the first one, build_model_ffn
runs successfully, the latter fails with a scalar indexing error. I also tried adapting the convolution layer to be 1D which results in the same error. It would be helpful to know any insights on the error resulting in a successful run of the second model.
The following includes more details of the error: