Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confused about nb_stacks #9

Closed
johnchenresearch opened this issue Jun 20, 2018 · 5 comments
Closed

Confused about nb_stacks #9

johnchenresearch opened this issue Jun 20, 2018 · 5 comments

Comments

@johnchenresearch
Copy link

johnchenresearch commented Jun 20, 2018

I'm reading the code and I'm just a little confused about the below lines:
for s in range(nb_stacks):
for i in dilatations:
x, skip_out = residual_block(x, s, i, activation, nb_filters, kernel_size)

What is the interpretation of this? In the paper, I had thought that each layer would have its own dilation rate, typically 2 ** i for the ith layer. What is happening here?

@alextheseal
Copy link

alextheseal commented Jun 25, 2018

I'm a bit confused about it too, but my understanding is that you can stack up the TCN blocks, increasing the receptive field as you do. So for a single stack, if the kernel size was 2, the dilations were [1,2,4,8], you would get the situation in the image below:

screen shot 2018-06-25 at 11 59 10 am

so a receptive field of 16.

If you specified 2 stacks my intuition is that you would get the situation below, that is, an increase in the receptive field to 32:

stack2

If you increased the number of stacks to 3, the size of the receptive field would increase again, such as below:

stack3

Philippe, can you please confirm whether my understanding is correct please.

@philipperemy
Copy link
Owner

@alextheseal I wrote that some times ago but it looks correct.

@alextheseal
Copy link

Thanks!

@philipperemy
Copy link
Owner

Yeah I updated the code to reflect this. It was a bit confusing sorry about that :)

@philipperemy
Copy link
Owner

I'll update it again to incorporate only one single parameter for the dilations: N

dilations = [2**i for i in range(N)]

So that when we specify N=4, it would mean [0, 1, 2, 4, 8]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants