I’m trying to translate my Keras code to PyTorch. In my Keras code I use GlobalMaxPooling1D after the last 1D convolutional layer:
result = GlobalMaxPooling1D()(previous_result).
In Pytorch I’m trying to use MaxPool1d. I guess the stride should be 0 but I’ve no idea about the value of kernel_size. Should it be the same size as the kernel in the last convolutional layer?
The “output_size” is just output size, not about the feature map, not batch_size. You can check the example in documentation. By printing the shape of input and output, you should get what you want.