cd04b76b7fd1d8ee1cfdb247bb794fd336f631a4,tensorflowTUT/tf15_tensorboard/full_code.py,,,#,35

Before Change


with tf.name_scope("loss"):
    loss = tf.reduce_mean(tf.reduce_sum(tf.square(ys - prediction),
                                        reduction_indices=[1]))
    tf.scalar_summary("loss", loss)

with tf.name_scope("train"):
    train_step = tf.train.GradientDescentOptimizer(0.1).minimize(loss)

After Change


with tf.name_scope("loss"):
    loss = tf.reduce_mean(tf.reduce_sum(tf.square(ys - prediction),
                                        reduction_indices=[1]))
    if int((tf.__version__).split(".")[1]) < 12:    // tensorflow version < 0.12
        tf.scalar_summary("loss", loss)
    else:   // tensorflow version >= 0.12
        tf.summary.scalar("loss", loss)

with tf.name_scope("train"):
    train_step = tf.train.GradientDescentOptimizer(0.1).minimize(loss)

sess = tf.Session()
if int((tf.__version__).split(".")[1]) < 12:  // tensorflow version < 0.12
    merged = tf.merge_all_summaries()
else:   // tensorflow version >= 0.12
    merged = tf.summary.merge_all()

// tf.train.SummaryWriter soon be deprecated, use following
if int((tf.__version__).split(".")[1]) < 12:  // tensorflow version < 0.12
    writer = tf.train.SummaryWriter("logs/", sess.graph)
else: // tensorflow version >= 0.12
    writer = tf.summary.FileWriter("logs/", sess.graph)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: MorvanZhou/tutorials
Commit Name: cd04b76b7fd1d8ee1cfdb247bb794fd336f631a4
Time: 2017-01-14
Author: morvanzhou@hotmail.com
File Name: tensorflowTUT/tf15_tensorboard/full_code.py
Class Name:
Method Name:


Project Name: MorvanZhou/tutorials
Commit Name: cd04b76b7fd1d8ee1cfdb247bb794fd336f631a4
Time: 2017-01-14
Author: morvanzhou@hotmail.com
File Name: tensorflowTUT/tf15_tensorboard/full_code.py
Class Name:
Method Name:


Project Name: GoogleCloudPlatform/cloudml-samples
Commit Name: 435560056e838c96100a0e80aee9dbbe57ea4c4f
Time: 2016-12-15
Author: joshgc@google.com
File Name: mnist/distributed/trainer/model.py
Class Name: Model
Method Name: build_graph


Project Name: GoogleCloudPlatform/cloudml-samples
Commit Name: 435560056e838c96100a0e80aee9dbbe57ea4c4f
Time: 2016-12-15
Author: joshgc@google.com
File Name: mnist/hptuning/trainer/model.py
Class Name: Model
Method Name: build_graph