[src] Correctrly treat subsampling factor != 1 in nnet3-get-egs #4183
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #4167
Dan, I do not like how easy and error-prone it currently is to confuse subsampled and continuous indices. I'm thinking of a helper struct constructed like
Resample resample(factor,offset)
with methodsint32 resample.Down(int32)
andint32 resample.Up(int32)
. I looked at the code if it were possible to have different, non-decayable separate types for continuous and downsampled indices, so that they cannot be assigned one to another, but it's probably not possible, as at some points we just simply do not know. But this helper I think I'll implement.I read other binaries' code to check if they have the same problem, and it's not very readable, and hard to trace. At the very least, an explicit object doing the trivial arithmetic should make the code a bit easier to grok.