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

Receptive field description and examples #207

Closed
strokovnjaka opened this issue Jun 4, 2021 · 2 comments
Closed

Receptive field description and examples #207

strokovnjaka opened this issue Jun 4, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@strokovnjaka
Copy link

My 5cents to the "In theory, the 2 is not justified. We are still not sure why in practice we need to add this 2 in the formula." question, as stated in the README.

The 2 is there because there are two Conv1d layers in a single ResidualBlock.

First, note that the cited paper states "This gives us two ways to increase the receptive field of the TCN: choosing larger filter sizes k and increasing the dilation factor d, where the effective history of one such layer is (k − 1)d."
In my opinion, that defines receptive field as "maximum number of steps back in time from current sample at time T, that a filter from (block, layer, stack, TCN) can hit", or something in that sense.
The README seems to define receptive field as "maximum number of samples that filters from (block, layer, stack, TCN) can hit", which is basically effective history + 1, so no big deal there.

So, a level i ResidualBlock's effective history is Eh = 2⋅(k-1)⋅di, with k being kernel size, and di being dilation for the ResidualBlock at level i.

Next, as ResidualBlocks are stacked in a stack, its Eh = Σ(2⋅(k-1)⋅di) = 2⋅(k-1)⋅Σdi.

Next, as N stacks are stacked, their Eh = N⋅2⋅(k-1)⋅Σdi.

As receptive field seems to be effective history plus current sample at time T, the formula Rfield = 1 + 2⋅(k-1)⋅N⋅Σdi is correct.

As far as example figures go, they do not match the formula. For the first figure of single stack 16 != 31 = 1 + 2⋅(2-1)⋅1⋅(1+2+4+8), and so on for others. Example figures include single Conv1d per layer, so the correct formula would be Rfield = 1 + (k-1)⋅N⋅Σdi (without the notorious 2).

Description for the formula states "...where Ns is the number of stacks, Nb is the number of residual blocks per stack...",
but formula references Nstacks. So instead of Ns use Nstacks, and somehow state that the number of residual blocks is
the number of di s in the formula (or, even better, replace the formula image)

To avoid confusion, stating the formula for the examples, as well as correcting formula's descriptions, would be great.
If, of course, the above is correct :)

@philipperemy
Copy link
Owner

@strokovnjaka thank you so much! I will update the README ;)

@philipperemy philipperemy added the enhancement New feature or request label Jan 20, 2022
@philipperemy
Copy link
Owner

d51c4ea

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

No branches or pull requests

2 participants