Skip to content

Conversation

2wins
Copy link
Contributor

@2wins 2wins commented Sep 25, 2018

Checklist

  • I've tested that my changes are compatible with the latest version of Tensorflow.
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary.

Motivation and Context

Description

This is for a new normalization layer, Group Normalization Layer.
Even if there is tf.contrib.layers.group_norm, it has an unsolved issue (link).

@zsdonghao
Copy link
Member

@DEKHTIARJonathan
Copy link
Member

@zsdonghao if its fine with you this PR will be merged only after TL 2.0

@wagamamaz
Copy link
Collaborator

It seen this layer only support 2D images?

mean, var = tf.nn.moments(x, [1, 2, 4], keep_dims=True)

@2wins
Copy link
Contributor Author

2wins commented Sep 25, 2018

@2wins Thanks.

Could you also change these two files:

@zsdonghao OK. I'll reflect it to them.

It seen this layer only support 2D images?

mean, var = tf.nn.moments(x, [1, 2, 4], keep_dims=True)

@wagamamaz Yes, I only consider 2D input case like InstanceNormLayer.

@wagamamaz
Copy link
Collaborator

@2wins I see, could you raise an exception if the input doesn't fix the shape?
Also, could we support channel_first using data_format? Many thanks.

@zsdonghao
Copy link
Member

@DEKHTIARJonathan I think this one can be merged first, we need to support these kinds of layers, and I have no idea when the 2.0 can be finished.. 😭

@2wins
Copy link
Contributor Author

2wins commented Sep 25, 2018

@wagamamaz We need to discuss data_format. Many layers we have do not support it normally as can be seen in #640.

@wagamamaz
Copy link
Collaborator

wagamamaz commented Sep 25, 2018

@2wins in the latest version, it seen that conv2d and many other layers already support channel_first, also the batch norm layer

self.outputs = tf.reshape(x, tf.shape(self.inputs)) * gamma + beta
self.outputs = self._apply_activation(self.outputs)

variables = tf.get_collection(TF_GRAPHKEYS_VARIABLES, scope=vs.name)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one will have error when two layers have similar name. Use the following instead:

https://github.com/tensorlayer/tensorlayer/blob/master/tensorlayer/layers/convolution/simplified_conv.py#L96

@2wins
Copy link
Contributor Author

2wins commented Sep 26, 2018

The commit Support in GroupNormLayer 27224ce
should be Support data_format in GroupNormLayer.

@wagamamaz wagamamaz merged commit 51eb841 into tensorlayer:master Sep 26, 2018
@2wins 2wins deleted the groupnorm branch September 30, 2018 11:35
luomai pushed a commit that referenced this pull request Nov 21, 2018
* Add GroupNormLayer

* minor modification

* minor modification

* Modify param description

* Modify docs

* minor modification

* Update normalization.py

* Update normalization.py

* Support  in GroupNormLayer
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 this pull request may close these issues.

5 participants