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:]

      labels_flat = tf.reshape(labels, [-1])
      mask_flat = tf.reshape(tf.sequence_mask(lengths, dtype=tf.float32), [-1])

After Change


      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))
Italian Trulli
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/models
Commit Name: 6cd426d917d10f3f334cb009d12db527ef81750f
Time: 2019-10-17
Author: jingli@google.com
File Name: official/nlp/xlnet/data_utils.py
Class Name:
Method Name: _local_perm


Project Name: danforthcenter/plantcv
Commit Name: 9dbe3f07cbf9a3d211bad1f7fc48fb7fab4cefcc
Time: 2019-08-22
Author: haleyschuhl@gmail.com
File Name: plantcv/plantcv/morphology/segment_insertion_angle.py
Class Name:
Method Name: segment_insertion_angle