34870dec55add27958d5d9267cf782ee1e2f39b9,vae.py,,train,#,77

Before Change


  train_op = optimizer.minimize(-elbo)

  // Merge all the summaries
  summary_op = tf.merge_all_summaries()

  init_op = tf.initialize_all_variables()

  // Run training

After Change


                                            hidden_size=FLAGS.hidden_size)
    prior_predictive = distributions.Bernoulli(logits=p_x_given_z_logits)
    prior_predictive_samples = prior_predictive.sample()
    tf.summary.image("prior_predictive",
                     tf.cast(prior_predictive_samples, tf.float32))

  // Take samples from the prior with a placeholder
  with tf.variable_scope("model", reuse=True):
    z_input = tf.placeholder(tf.float32, [None, FLAGS.latent_dim])
    p_x_given_z_logits = generative_network(z=z_input,
                                            hidden_size=FLAGS.hidden_size)
    prior_predictive_inp = distributions.Bernoulli(logits=p_x_given_z_logits)
    prior_predictive_inp_sample = prior_predictive_inp.sample()

  // Build the evidence lower bound (ELBO) or the negative loss
  kl = tf.reduce_sum(distributions.kl(q_z.distribution, p_z), 1)
  expected_log_likelihood = tf.reduce_sum(p_x_given_z.log_pmf(x),
                                          [1, 2, 3])

  elbo = tf.reduce_sum(expected_log_likelihood - kl, 0)

  optimizer = tf.train.RMSPropOptimizer(learning_rate=0.001)

  train_op = optimizer.minimize(-elbo)

  // Merge all the summaries
  summary_op = tf.summary.merge_all()

  init_op = tf.global_variables_initializer()

  // Run training
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: altosaar/variational-autoencoder
Commit Name: 34870dec55add27958d5d9267cf782ee1e2f39b9
Time: 2016-12-22
Author: jaan.altosaar@gmail.com
File Name: vae.py
Class Name:
Method Name: train


Project Name: altosaar/variational-autoencoder
Commit Name: 34870dec55add27958d5d9267cf782ee1e2f39b9
Time: 2016-12-22
Author: jaan.altosaar@gmail.com
File Name: vae.py
Class Name:
Method Name: train


Project Name: SullyChen/Autopilot-TensorFlow
Commit Name: 88508420f66fc7c3baa5f362893d3a4b5de11a16
Time: 2019-01-21
Author: emmanuel.sciara@gmail.com
File Name: train.py
Class Name:
Method Name:


Project Name: MorvanZhou/tutorials
Commit Name: bd0245981d11faa2aad750fc32821205689da874
Time: 2017-03-18
Author: morvanzhou@hotmail.com
File Name: tensorflowTUT/tf17_dropout/full_code.py
Class Name:
Method Name:


Project Name: jakeret/tf_unet
Commit Name: 6f1a876bf8614a7aa0f1a7043d2f15f0b3064d5f
Time: 2016-12-27
Author: jakeret@phys.ethz.ch
File Name: tf_unet/unet.py
Class Name: Trainer
Method Name: _initialize