16dcaf16ef8e96c7d7b2649cdb7296b2341b7510,imaging/ml/ml_codelab/scripts/trainer/model.py,,_create_inference_graph,#Any#Any#,297

Before Change


  // Cloud ML requires dynamic batch sizes, so set shape to [None].
  input_jpeg_str = tf.placeholder(tf.string, shape=[None])
  // For each instance in batch, calculate the bottleneck.
  bottleneck_tensor = tf.map_fn(
      ml_utils.get_bottleneck_tensor,
      input_jpeg_str,
      back_prop=False,
      dtype=tf.float32)
  // Reduce dimension in bottleneck - we want to feed a BATCH_SIZE x 2048 tensor
  // to dense layer, to produce a BATCH_SIZE x NUMBER_OF_CLASSES tensor.
  bottleneck_tensor = tf.squeeze(bottleneck_tensor, [1])
  _, normalized_tensor, prediction_index = _create_dense_and_softmax_layers(

After Change


    score is the score for the predicted label.
  

  img_bytes, bottleneck_tensor = ml_utils.create_fixed_weight_input_graph()
  _, normalized_tensor, prediction_index = _create_dense_and_softmax_layers(
      bottleneck_tensor, class_count)
  // Get the prediction (label) for a given tensor index.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: GoogleCloudPlatform/healthcare
Commit Name: 16dcaf16ef8e96c7d7b2649cdb7296b2341b7510
Time: 2020-02-13
Author: sadeel@google.com
File Name: imaging/ml/ml_codelab/scripts/trainer/model.py
Class Name:
Method Name: _create_inference_graph


Project Name: tensorflow/models
Commit Name: 0d6ce6025ffc2bed437160fc8b2e9934b3f82fad
Time: 2021-01-28
Author: rathodv@google.com
File Name: research/object_detection/exporter_lib_v2.py
Class Name: DetectionFromTFExampleModule
Method Name: __call__


Project Name: tensorflow/models
Commit Name: 0d6ce6025ffc2bed437160fc8b2e9934b3f82fad
Time: 2021-01-28
Author: rathodv@google.com
File Name: research/object_detection/exporter_lib_v2.py
Class Name: DetectionFromEncodedImageModule
Method Name: __call__