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

Normalization & Gamma #20

Open
jubueche opened this issue Sep 20, 2018 · 0 comments
Open

Normalization & Gamma #20

jubueche opened this issue Sep 20, 2018 · 0 comments

Comments

@jubueche
Copy link

I don't understand two points in your code:

if l == L: #Convert z and apply softmax for the last layer. (TODO: Only for prediction or if we pass through encoder?) h = tf.nn.softmax(weights['gamma'][l-1] * (z+weights['beta'][l-1])) else: h = tf.nn.relu(z + weights['beta'][l-1]) #TODO: No gamma?

Why do you leave out the gamma in the second calculation? I neither Valpola2015 nor Bengio2016 I can see a reason for this. Maybe you can explain.

Second:
def eval_batch_norm(): # Evaluation batch normalization # obtain average mean and variance and use it to normalize the batch mean = ewma.average(running_mean[l-1]) var = ewma.average(running_var[l-1]) z = batch_normalization(z_pre, mean, var) return z

I don't understand, why we are using the std and mean from the labeled data that we have accumulated (is this correct?). I thought for evaluation we are using the batchmean and batchstd.

Also another thing: I am sure I was just too lazy to understand, but are we also saving the labeled data in the dictionary under 'unlabeled'?
The reason I think this is, that in the decoding phase we are only using the data 'unlabeled', but we also must learn on the labeled data (take the recons. cost into account). Especially if we have only labeled data.
I hope there is still somebody active here!

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

No branches or pull requests

1 participant