e9086f5d37f5f46b8327bf022c7b0c70d42460d1,magenta/models/shared/events_rnn_graph.py,,build_graph,#Any#Any#Any#,56
Before Change
if mode == "train" or mode == "eval":
if hparams.skip_first_n_losses:
logits = tf.reshape(logits_flat, [hparams.batch_size, -1, num_classes])
logits = logits[:, hparams.skip_first_n_losses:, :]
logits_flat = tf.reshape(logits, [-1, num_classes])
labels = labels[:, hparams.skip_first_n_losses:]
After Change
labels_flat = tf.reshape(labels, [-1])
mask = tf.sequence_mask(lengths)
if hparams.skip_first_n_losses:
skip = tf.minimum(lengths, hparams.skip_first_n_losses)
skip_mask = tf.sequence_mask(skip, maxlen=tf.reduce_max(lengths))
mask = tf.logical_and(mask, tf.logical_not(skip_mask))
mask = tf.cast(mask, tf.float32)
mask_flat = tf.reshape(mask, [-1])
num_logits = tf.to_float(tf.reduce_sum(lengths))
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: tensorflow/magenta
Commit Name: e9086f5d37f5f46b8327bf022c7b0c70d42460d1
Time: 2017-03-23
Author: earnest.marshi@gmail.com
File Name: magenta/models/shared/events_rnn_graph.py
Class Name:
Method Name: build_graph
Project Name: tensorflow/cleverhans
Commit Name: 68fe96add85bd842df23569dde490e1694d256fe
Time: 2019-06-21
Author: siarheisiniak@yahoo.com
File Name: cleverhans/model_zoo/deep_k_nearest_neighbors/dknn.py
Class Name: DkNNModel
Method Name: find_train_knns
Project Name: calico/basenji
Commit Name: def1a4ccb2d39b0f48d6663f7378e5b332f4f667
Time: 2016-09-28
Author: drk@calicolabs.com
File Name: basenji/rnn.py
Class Name: RNN
Method Name: test