{"action":"created","issue":{"url":"https://api.github.com/repos/tensorflow/tensorflow/issues/7091","repository_url":"https://api.github.com/repos/tensorflow/tensorflow","labels_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/7091/labels{/name}","comments_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/7091/comments","events_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/7091/events","html_url":"https://github.com/tensorflow/tensorflow/issues/7091","id":203380582,"number":7091,"title":"Feature request: let tf.contrib.layers.batch_norm normalize over more axes than just the last one","user":{"login":"carlthome","id":1595907,"avatar_url":"https://avatars.githubusercontent.com/u/1595907?v=3","gravatar_id":"","url":"https://api.github.com/users/carlthome","html_url":"https://github.com/carlthome","followers_url":"https://api.github.com/users/carlthome/followers","following_url":"https://api.github.com/users/carlthome/following{/other_user}","gists_url":"https://api.github.com/users/carlthome/gists{/gist_id}","starred_url":"https://api.github.com/users/carlthome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carlthome/subscriptions","organizations_url":"https://api.github.com/users/carlthome/orgs","repos_url":"https://api.github.com/users/carlthome/repos","events_url":"https://api.github.com/users/carlthome/events{/privacy}","received_events_url":"https://api.github.com/users/carlthome/received_events","type":"User","site_admin":false},"labels":[{"id":522623856,"url":"https://api.github.com/repos/tensorflow/tensorflow/labels/API%20review","name":"API review","color":"d4c5f9","default":false},{"id":473173272,"url":"https://api.github.com/repos/tensorflow/tensorflow/labels/type:feature","name":"type:feature","color":"c2e0c6","default":false}],"state":"open","locked":false,"assignee":{"login":"martinwicke","id":577277,"avatar_url":"https://avatars.githubusercontent.com/u/577277?v=3","gravatar_id":"","url":"https://api.github.com/users/martinwicke","html_url":"https://github.com/martinwicke","followers_url":"https://api.github.com/users/martinwicke/followers","following_url":"https://api.github.com/users/martinwicke/following{/other_user}","gists_url":"https://api.github.com/users/martinwicke/gists{/gist_id}","starred_url":"https://api.github.com/users/martinwicke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinwicke/subscriptions","organizations_url":"https://api.github.com/users/martinwicke/orgs","repos_url":"https://api.github.com/users/martinwicke/repos","events_url":"https://api.github.com/users/martinwicke/events{/privacy}","received_events_url":"https://api.github.com/users/martinwicke/received_events","type":"User","site_admin":false},"assignees":[{"login":"martinwicke","id":577277,"avatar_url":"https://avatars.githubusercontent.com/u/577277?v=3","gravatar_id":"","url":"https://api.github.com/users/martinwicke","html_url":"https://github.com/martinwicke","followers_url":"https://api.github.com/users/martinwicke/followers","following_url":"https://api.github.com/users/martinwicke/following{/other_user}","gists_url":"https://api.github.com/users/martinwicke/gists{/gist_id}","starred_url":"https://api.github.com/users/martinwicke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinwicke/subscriptions","organizations_url":"https://api.github.com/users/martinwicke/orgs","repos_url":"https://api.github.com/users/martinwicke/repos","events_url":"https://api.github.com/users/martinwicke/events{/privacy}","received_events_url":"https://api.github.com/users/martinwicke/received_events","type":"User","site_admin":false}],"milestone":null,"comments":6,"created_at":"2017-01-26T14:12:34Z","updated_at":"2017-01-27T09:26:41Z","closed_at":null,"body":"When using `tf.nn.batch_normalization` and `tf.nn.moments` it's possible to choose which axes are aggregated and thus which dimensions are normalized over. For `tf.contrib.layers.batch_norm` and `tf.contrib.layers.layer_norm` the assumption is that only the last dimension will be normalized over. This is standard practice for filters in ConvNets, or the features in fully-connected layers, but there are use cases where it would be nice to independently normalize across both width and filters (for example audio spectrograms, where \"width\" could be seen as the time axis). Could the layers API be changed to be a little more flexible or is the current consensus that `tf.nn.batch_normalization` is the way to go?"},"comment":{"url":"https://api.github.com/repos/tensorflow/tensorflow/issues/comments/275622819","html_url":"https://github.com/tensorflow/tensorflow/issues/7091#issuecomment-275622819","issue_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/7091","id":275622819,"user":{"login":"carlthome","id":1595907,"avatar_url":"https://avatars.githubusercontent.com/u/1595907?v=3","gravatar_id":"","url":"https://api.github.com/users/carlthome","html_url":"https://github.com/carlthome","followers_url":"https://api.github.com/users/carlthome/followers","following_url":"https://api.github.com/users/carlthome/following{/other_user}","gists_url":"https://api.github.com/users/carlthome/gists{/gist_id}","starred_url":"https://api.github.com/users/carlthome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carlthome/subscriptions","organizations_url":"https://api.github.com/users/carlthome/orgs","repos_url":"https://api.github.com/users/carlthome/repos","events_url":"https://api.github.com/users/carlthome/events{/privacy}","received_events_url":"https://api.github.com/users/carlthome/received_events","type":"User","site_admin":false},"created_at":"2017-01-27T09:26:41Z","updated_at":"2017-01-27T09:26:41Z","body":"I'd expect `tf.contrib.layers.batch_norm(..., axis=[0, 1, 2])` to work, just it it does for `tf.nn.moments`.\r\n\r\nFor backwards compatibility (where all but the last dimension should be reduced) `axis=None` is necessary as the default argument because the shape of the input tensor is not known, with documented behavior that it aggregates every dimension except for the last."}}
{"actor":{"display_login":"carlthome"}}