Is it possible to do one sided padding with a Conv1d?

I’m attempting to give me data more temporal understanding. To do that, I want to pad only the left side with each successive layer so that I’ll maintain the same shape, but progressively “roll up” information from the older / earlier elements. Is this possible with PyTorch?

You could leave padding=0 in the conv layers and use F.pad in the forward method to pad one-sided.

1 Like

You can also use a larger padding, and then throw away the last couple of outputs to maintain the size.