I’m trying to implement this network from keras to pytorch, not sure if it’s workable. The target model in keras is as following:
input_7 (InputLayer) (None, 200, 76) 0
____________________________________________________________________________________________________
conv_1 (Convolution1D) (None, 192, 10) 6850 input_7[0][0]
____________________________________________________________________________________________________
conv_2 (Convolution1D) (None, 184, 10) 910 conv_1[0][0]
____________________________________________________________________________________________________
conv_3 (Convolution1D) (None, 174, 20) 2220 conv_2[0][0]
____________________________________________________________________________________________________
But the PyTorch seems to have a different API for conv1d. I tried this:
nn.Sequential(
nn.Conv1d(in_channels=200, out_channels=192, kernel_size=10),
nn.ReLU(),
nn.Conv1d(in_channels=192, out_channels=184, kernel_size=10),
nn.ReLU(),
nn.Conv1d(in_channels=184, out_channels=174, kernel_size=20),
nn.ReLU(),
)
which seems not working properly.
The kernel_size
in keras Convolution1D doesn’t seem very simple to transfer to conv1d
in PyTorch.
Appreciate any help.