google-research / mixmatch

Apache License 2.0
1.13k stars 163 forks source link

A question about "post_ops" in mixmatch.py #24

Closed chencjGene closed 4 years ago

chencjGene commented 4 years ago

Hi, I do not how what is the "post_ops" in the following codes for? could you help explain for it?

batches = layers.interleave([x] + y, batch) skip_ops = tf.get_collection(tf.GraphKeys.UPDATE_OPS) logits = [classifier(batches[0], training=True)] post_ops = [v for v in tf.get_collection(tf.GraphKeys.UPDATE_OPS) if v not in skip_ops]

david-berthelot commented 4 years ago

In this code snippet, post_ops collects the operations to update batch norm estimates of mean and variance. Tensorflow automatically puts them inside the tf.GraphKeys.UPDATE_OPS collection.

chencjGene commented 4 years ago

Got it! Thanks.