Computing the network output and the size of the convolution in the padding size explanation TCN

Convolution network output size

Consider only one dimension on the size, the size of a convolutional neural network input is set n, kernel_size is k, padding is p, stride of s, dilation of d, the output size is n '.

Then when d = 1, when S =. 1, {n}'=n+2p-k+1;

To extend the above formula generalized:

Only if d = 1, then {n}' = \lfloor \frac{n+2p-k}{s}+1 \rfloor;

If only s = 1, then {n}'=n+2p-k+1-(k-1)(d-1)=n+2p-(k-1)d;

 

Time convolution in padding the size of the network TCN

TCN only limitation s = 1, so that the normal size of the convolution {n}'=n+2p-(k-1)d.

But TCN can only look forward, not look back, so there will be a function of a convolution after TCN behind chomp1d will expand the size of the multi-length padding to delete, therefore, chomp1d after output size {n}''={n}'-p=n+p-(k-1)d.

Since the layer required TCN equal input and output lengths, it should have {n}''=n, so to obtain more comprehensive p=(k-1)d.

 

Published 10 original articles · won praise 0 · Views 1589

Guess you like

Origin blog.csdn.net/cly141220010/article/details/103979107