localminimum / localminimum/QANet

layer normalization in layer?

Open
#44 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
985
Forks
297
PR merge metrics
No merged PRs in 30d

Description

https://github.com/NLPLearn/QANet/blob/8107d223897775d0c3838cb97f93b089908781d4/layers.py#L52

execuse me, in the paper "Layer Normalization,Lei Jimmy Ba, Ryan Kiros, and Geoffrey E. Hinton", it said that the mean and variance is computed over all the hidden units in the same layer, and different training cases have different normalization terms. So I think the mean should be computed like this:
```python
axes = list(range(1, x.shape.ndims))
mean = tf.reduce_mean(x, axes)
```
So the shape of mean is [batch,]. also the variance is [batch,]
and then feed them to compute the normlized x.

In the tensorflow api of layer normalization, the source code is below, and I think it is the same with mine.
` norm_axes = list(range(begin_norm_axis, inputs_rank))`
https://github.com/tensorflow/tensorflow/blob/c19e29306ce1777456b2dbb3a14f511edf7883a8/tensorflow/contrib/layers/python/layers/layers.py#L2311

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading layers.py at line 52 and compare its normalization axes with the Layer Normalization paper and the linked TensorFlow layer-normalization implementation. Confirm that the mean and variance are computed per training case across the hidden units, then verify the resulting behavior with the repository's available checks.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, tensorflow
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.