3a5ace850931e91c55a692ae7ec716a57e66f4e6,niftynet/layer/loss_segmentation.py,LossFunction,layer_op,#LossFunction#Any#Any#Any#,46

Before Change


        with tf.device("/cpu:0"):

            batch_size = ground_truth.get_shape()[0].value
            ground_truth = tf.reshape(ground_truth, [batch_size, -1])
            if weight_map is not None:
                weight_map = tf.reshape(weight_map, [batch_size, -1])
            // assumes same gt and weight across scales

After Change


                    // performs softmax if required
                    if self._softmax:
                        pred_b = tf.cast(pred_b, dtype=tf.float32)
                        pred_b = tf.nn.softmax(pred_b)

                    // reshape pred, ground_truth, weight_map to the same
                    // size: (n_voxels, num_classes)
                    // if the ground_truth has only one channel, the shape
                    // becomes: (n_voxels,)
                    spatial_shape = pred_b.get_shape().as_list()[:-1]
                    ref_shape = spatial_shape + [-1]
                    ground_truth_b = tf.reshape(ground_truth[b_ind], ref_shape)
                    if ground_truth_b.get_shape().as_list()[-1] == 1:
                        ground_truth_b = tf.squeeze(ground_truth_b, axis=-1)
                    if weight_map is not None:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: NifTK/NiftyNet
Commit Name: 3a5ace850931e91c55a692ae7ec716a57e66f4e6
Time: 2018-01-26
Author: wenqi.li@ucl.ac.uk
File Name: niftynet/layer/loss_segmentation.py
Class Name: LossFunction
Method Name: layer_op


Project Name: NifTK/NiftyNet
Commit Name: a1172cf54f3a14fb57e6b6405ce58f29ef543334
Time: 2017-08-24
Author: eli.gibson@gmail.com
File Name: niftynet/network/dense_vnet.py
Class Name: DenseVNet
Method Name: layer_op


Project Name: NifTK/NiftyNet
Commit Name: 4421754f9886233e90563eb8088348bb36024095
Time: 2018-01-12
Author: wenqi.li@ucl.ac.uk
File Name: niftynet/layer/loss_segmentation.py
Class Name: LossFunction
Method Name: layer_op