c3ac58c90f2fe330eb036744fba3af2c14426fdc,doc_seg/model.py,,model_fn,#Any#Any#Any#Any#,9
Before Change
if training_params.training_margin > 0:
margin = training_params.training_margin
loss = tf.reduce_mean(per_pixel_loss[:, margin:-margin, margin:-margin], name="loss")
else:
loss = tf.reduce_mean(per_pixel_loss, name="loss")
After Change
margin = training_params.training_margin
input_shapes = features["shapes"]
with tf.name_scope("Loss"):
def _fn(_in):
output, shape = _in
return tf.reduce_mean(output[margin:shape[0]-margin, margin:shape[1]-margin])
per_img_loss = tf.map_fn(_fn, (per_pixel_loss, input_shapes), dtype=tf.float32)
loss = tf.reduce_mean(per_img_loss, name="loss")
loss += regularized_loss
else:
loss = None
In pattern: SUPERPATTERN
Frequency: 5
Non-data size: 4
Instances
Project Name: dhlab-epfl/dhSegment
Commit Name: c3ac58c90f2fe330eb036744fba3af2c14426fdc
Time: 2018-01-17
Author: seg.benoit@gmail.com
File Name: doc_seg/model.py
Class Name:
Method Name: model_fn
Project Name: tensorflow/transform
Commit Name: 30def1a72c54b5635a2ed59bf03ecc10bef1a845
Time: 2018-02-20
Author: tf-transform-dev@google.com
File Name: tensorflow_transform/beam/impl.py
Class Name: AnalyzeDataset
Method Name: expand
Project Name: tensorflow/transform
Commit Name: 54e07bdb2ba299fd6f364289510612f2fe6af8ff
Time: 2018-11-28
Author: tf-transform-dev@google.com
File Name: tensorflow_transform/analyzers.py
Class Name:
Method Name: _quantiles_per_key
Project Name: tensorflow/ranking
Commit Name: 27aef1f3aa3dff22df125ca8a2fa4a4447ac6234
Time: 2019-08-13
Author: xuanhui@google.com
File Name: tensorflow_ranking/python/utils.py
Class Name:
Method Name: organize_valid_indices
Project Name: tensorflow/transform
Commit Name: 76bfb4027c2a04d1d65dbfc3befdc2805133c957
Time: 2017-05-16
Author: no-reply@google.com
File Name: tensorflow_transform/analyzers.py
Class Name:
Method Name: uniques