KEMBAR78
Fix setting using running stats in InstanceNorm*d by ssnl · Pull Request #4444 · pytorch/pytorch · GitHub
Skip to content

Conversation

@ssnl
Copy link
Collaborator

@ssnl ssnl commented Jan 2, 2018

The original docs about .training(False) uses running stats are wrong. This line always uses training=True when calling BN backend function. This PR fixes the doc, and adds a method to control whether using running stats or instance stats.

Fixes #4348 .

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

@ssnl
Copy link
Collaborator Author

ssnl commented Jan 2, 2018

@pytorch/buildbot retest this please

@ssnl
Copy link
Collaborator Author

ssnl commented Jan 2, 2018

@pytorchbot retest this please

1 similar comment
@ssnl
Copy link
Collaborator Author

ssnl commented Jan 2, 2018

@pytorchbot retest this please

@soumith soumith merged commit b062769 into pytorch:master Jan 4, 2018
def __init__(self, num_features, eps=1e-5, momentum=0.1, affine=False):
super(_InstanceNorm, self).__init__(
num_features, eps, momentum, affine)
self.use_running_stats = False

This comment was marked as off-topic.

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

torch.nn.InstanceNorm1d has inconsistent semantics of train and eval

5 participants