981e4266d4ea816b08a762193bd52f40cd1a3242,examples/mnist/keras/mnist_inference.py,,inference,#,26

Before Change


  output_file = tf.gfile.GFile("{}/part-{:05d}".format(args.output, worker_num), mode="w")

  while True:
    try:
      // get images and labels from tf.data.Dataset
      img, lbl = sess.run(["inf_image:0", "inf_image:1"])

      // inference by feeding these images and labels into the input tensors
      // you can view the exported model signatures via:
      //     saved_model_cli show --dir <export_dir> --all

      // note that we feed directly into the graph tensors (bypassing the exported signatures)
      // these tensors will be shown in the "name" field of the signature definitions

      outputs = sess.run(["dense_2/Softmax:0"], feed_dict={"Placeholder:0": img})
      for p in outputs[0]:
        output_file.write("{}\n".format(np.argmax(p)))
    except tf.errors.OutOfRangeError:
      break

  output_file.close()


if __name__ == "__main__":

After Change


    predictions = predict(conv2d_input=batch[0])
    labels = np.reshape(batch[1], -1).astype(np.int)
    preds = np.argmax(predictions["dense_1"], axis=1)
    for x in zip(labels, preds):
      output_file.write("{} {}\n".format(x[0], x[1]))

  output_file.close()


if __name__ == "__main__":
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: yahoo/TensorFlowOnSpark
Commit Name: 981e4266d4ea816b08a762193bd52f40cd1a3242
Time: 2019-08-07
Author: leewyang@verizonmedia.com
File Name: examples/mnist/keras/mnist_inference.py
Class Name:
Method Name: inference


Project Name: nilearn/nilearn
Commit Name: 9b9095f877f603d91495c72f91e4fddf61f1724e
Time: 2019-07-22
Author: jerome@dockes.org
File Name: examples/02_decoding/plot_haxby_stimuli.py
Class Name:
Method Name:


Project Name: fgnt/pb_bss
Commit Name: dd7096573ce182331bddeef3e5168e886d8ffe68
Time: 2019-12-03
Author: mail@lukas-drude.de
File Name: pb_bss/evaluation/wrapper.py
Class Name: OutputMetrics
Method Name: pesq


Project Name: fgnt/pb_bss
Commit Name: dd7096573ce182331bddeef3e5168e886d8ffe68
Time: 2019-12-03
Author: mail@lukas-drude.de
File Name: pb_bss/evaluation/wrapper.py
Class Name: InputMetrics
Method Name: pesq