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

Misleading InstanceNorm documentation? #1308

Closed
nikitati opened this issue Aug 7, 2020 · 0 comments · Fixed by #1397
Closed

Misleading InstanceNorm documentation? #1308

nikitati opened this issue Aug 7, 2020 · 0 comments · Fixed by #1397

Comments

@nikitati
Copy link

nikitati commented Aug 7, 2020

InstanceNorm documentation says:

Given an array with N dimensions, call the N-1th the channel dimension. (For
a batch of feature vectors this is just the data dimension, for WHCN images
it's the usual channel dimension.)

following with an example:

m = Chain(
  Dense(28^2, 64),
  InstanceNorm(64, relu),
  Dense(64, 10),
  InstanceNorm(10),
  softmax)

as far as I understand, the docs say that the layer can in principle be used on a batch of feature vectors (with shape DxN). However, the implementation actually does not support this behavior and throws an exception if it encounters 2D data:

 ndims(x) > 2 ||
    error("InstanceNorm requires at least 3 dimensions. With 2 dimensions an array of zeros would be returned")

This makes it impossible to reproduce the example. So if I interpret it corretly, the docs and the implementation disagree.

@nikitati nikitati changed the title Misleading InstanceNorm documentation Misleading InstanceNorm documentation? Aug 8, 2020
@bors bors bot closed this as completed in 7e9a180 Feb 4, 2021
@bors bors bot closed this as completed in #1397 Feb 4, 2021
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

Successfully merging a pull request may close this issue.

1 participant