Keras to Pytorch -> troubles with layers and shape
I am in the process of converting a Keras model to PyTorch and would need your help.
Keras Code:
def model(input_shape):
    input_layer = keras.layers.Input(input_shape)
    conv1 = keras.layers.Conv1D(filters=16, kernel_size=3, padding=&quot;same&quot;)(input_layer)
    conv1 = keras.layers.BatchNormalization()(conv1)
    conv1 = keras.layers.ReLU()(conv1)
    global_average_pooling = keras.layers.GlobalAveragePooling1D()(conv1)
    output_layer = keras.layers.Dense(number_of_classes, activation=&quot;softmax&quot;)(global_average_pooling )
    return keras.models.Model(inputs=input_layer, outputs=output_layer) 

Summary of Model:

My Code Is:
class model(nn.Module):
    def __init__(self):
        super(CNN, self).__init__()
        #number_of_classes = data_config.number_of_classes
        self.conv1 = nn.Conv1d(256,128,1) # PyTorch does not support same padding, 
        self.bn1=nn.BatchNorm1d(128)
        #self.relu=nn.functional.relu_(16)
        self.avg = nn.AvgPool1d(1)
        
    def forward(self,x):
        x = self.conv1(x)
        x = self.bn1(x)
        #x = self.relu(x)
        x = self.avg(x)
        output = F.log_softmax(x)
        return output

Could someone please help me with this?
Greets!

My Current Code is:
class Net(nn.Module):
    def __init__(self):
        super(Net,self).__init__()
        self.conv1 = nn.Conv1d(256,128,1)
        self.batch1 = nn.BatchNorm1d(128)
        self.avgpl1 = nn.AvgPool1d(1, stride=1)
        self.fc1 = nn.Linear(128,3)
    
    def forward(self,x):
        x = self.conv1(x)
        x = self.batch1(x)
        x = F.relu(x)
        x = self.avgpl1(x)
        x = torch.flatten(x,1)
        x = F.log_softmax(self.fc1(x))
        return x

Keras Model Parameters:

And my Parameters currently are:

