5fb4404583ecffdee8cf98e4ae9e0a91d479f071,niftynet/layer/loss_regression.py,LossFunction,layer_op,#LossFunction#Any#Any#Any#,26

Before Change


            for ind, pred in enumerate(prediction):
                // go through each scale

                loss_batch = []
                for b_ind, pred_b in enumerate(tf.unstack(pred, axis=0)):
                    // go through each image in a batch

                    pred_b = tf.reshape(pred_b, [-1])

After Change



                    return tf.to_float(self._data_loss_func(**loss_params))

                loss_batch = tf.map_fn(
                    fn=_batch_i_loss,
                    elems=tf.range(tf.shape(pred)[0], dtype=tf.int32),
                    dtype=tf.float32,
                    parallel_iterations=1)
                data_loss.append(tf.reduce_mean(loss_batch))
            return tf.reduce_mean(data_loss)

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 5

Instances


Project Name: NifTK/NiftyNet
Commit Name: 5fb4404583ecffdee8cf98e4ae9e0a91d479f071
Time: 2018-08-07
Author: wenqi.li@ucl.ac.uk
File Name: niftynet/layer/loss_regression.py
Class Name: LossFunction
Method Name: layer_op


Project Name: NifTK/NiftyNet
Commit Name: 5fb4404583ecffdee8cf98e4ae9e0a91d479f071
Time: 2018-08-07
Author: wenqi.li@ucl.ac.uk
File Name: niftynet/layer/loss_segmentation.py
Class Name: LossFunction
Method Name: layer_op


Project Name: tensorflow/models
Commit Name: 4ddc9f2d806530ceb99a86a621075a4a9813df62
Time: 2017-07-18
Author: derekjchow@gmail.com
File Name: object_detection/exporter.py
Class Name:
Method Name: _tf_example_input_placeholder


Project Name: NifTK/NiftyNet
Commit Name: 5fb4404583ecffdee8cf98e4ae9e0a91d479f071
Time: 2018-08-07
Author: wenqi.li@ucl.ac.uk
File Name: niftynet/layer/loss_regression.py
Class Name: LossFunction
Method Name: layer_op


Project Name: tensorflow/models
Commit Name: 4ddc9f2d806530ceb99a86a621075a4a9813df62
Time: 2017-07-18
Author: derekjchow@gmail.com
File Name: object_detection/exporter.py
Class Name:
Method Name: _encoded_image_string_tensor_input_placeholder