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")

        loss += regularized_loss

After Change


            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:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

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: RasaHQ/rasa
Commit Name: d4a2f656470e3190f8e877139455abcff1ad7cdb
Time: 2018-09-28
Author: mr.voov@gmail.com
File Name: rasa_core/policies/tf_utils.py
Class Name: TimedNTM
Method Name: __call__


Project Name: GPflow/GPflow
Commit Name: e6ce836b2925a677d0924e8859439937ba5808dc
Time: 2019-03-18
Author: sergio.diaz@prowler.io
File Name: gpflow/conditionals/mo_conditionals.py
Class Name:
Method Name: _conditional