0bf56c5e8db53e152e7095087499d072018283e6,src/test.py,,model_fn,#Any#Any#Any#,132

Before Change


        global_step = tf.train.get_or_create_global_step()
        step_ops = [loss, label_error, sequence_error]

        logging_hook = tf.train.LoggingTensorHook({"global_step": global_step, 
                                                   "loss" : loss, 
                                                   "label_error" : label_error,
                                                   "sequence_error" : sequence_error}, 
                                                  every_n_iter=100)
    return tf.estimator.EstimatorSpec(mode=mode, loss=loss, predictions=tf.nn.softmax(logits), 
                                      train_op=None, prediction_hooks=[logging_hook])

After Change



        global_step = tf.convert_to_tensor(tf.train.get_or_create_global_step())
        global_step = tf.cast(global_step, tf.float32)
        sequence_error = tf.cast(sequence_error, tf.float32)

        //Get the correct format to pass tp estimator spec
        result = tf.convert_to_tensor([(tf.stack([global_step,
                                                  loss, 
                                                  label_error, 
                                                  sequence_error], axis=0))])

    return tf.estimator.EstimatorSpec(mode=mode, loss=loss, 
                                      predictions=result, 
                                      train_op=None)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: weinman/cnn_lstm_ctc_ocr
Commit Name: 0bf56c5e8db53e152e7095087499d072018283e6
Time: 2018-06-29
Author: am.lamsal@gmail.com
File Name: src/test.py
Class Name:
Method Name: model_fn


Project Name: tryolabs/luminoth
Commit Name: dfe26d7233aaccb1d344ff9ba9995d722503b7e7
Time: 2018-03-20
Author: joaquin.alori@gmail.com
File Name: luminoth/models/ssd/ssd.py
Class Name: SSD
Method Name: _build


Project Name: haotianteng/Chiron
Commit Name: 3cdd0ddb974ba967e9d39e9b275bedc89badd73b
Time: 2018-09-07
Author: havens.teng@gmail.com
File Name: chiron/export_test.py
Class Name:
Method Name: input_output_list


Project Name: weinman/cnn_lstm_ctc_ocr
Commit Name: 0bf56c5e8db53e152e7095087499d072018283e6
Time: 2018-06-29
Author: am.lamsal@gmail.com
File Name: src/test.py
Class Name:
Method Name: model_fn