dfe2a43fb378b557f3dfc4315417afb291cd16b7,official/mnist/mnist_tpu.py,,model_fn,#Any#Any#Any#Any#,81

Before Change


  model_fn constructs the ML model used to predict handwritten digits.

  del params
  if mode == tf.estimator.ModeKeys.PREDICT:
    raise RuntimeError("mode {} is not supported yet".format(mode))
  image = features
  if isinstance(image, dict):
    image = features["image"]

After Change


  if mode == tf.estimator.ModeKeys.PREDICT:
    logits = model(image, training=False)
    predictions = {
        "class_ids": tf.argmax(logits, axis=1),
        "probabilities": tf.nn.softmax(logits),
        "label": labels,
    }
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: tensorflow/models
Commit Name: dfe2a43fb378b557f3dfc4315417afb291cd16b7
Time: 2018-09-25
Author: aman2930@gmail.com
File Name: official/mnist/mnist_tpu.py
Class Name:
Method Name: model_fn


Project Name: scikit-learn-contrib/DESlib
Commit Name: e8d6fd1a77df735a6362003014515d8249617011
Time: 2021-03-27
Author: rafaelmenelau@gmail.com
File Name: deslib/des/des_mi.py
Class Name: DESMI
Method Name: classify_with_ds


Project Name: scikit-learn-contrib/DESlib
Commit Name: e8d6fd1a77df735a6362003014515d8249617011
Time: 2021-03-27
Author: rafaelmenelau@gmail.com
File Name: deslib/des/des_clustering.py
Class Name: DESClustering
Method Name: classify_with_ds