5fb4404583ecffdee8cf98e4ae9e0a91d479f071,niftynet/layer/loss_segmentation.py,LossFunction,layer_op,#LossFunction#Any#Any#Any#,46
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, self._num_classes])
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)
// loss averaged over batch
data_loss.append(tf.reduce_mean(loss_batch))
// loss averaged over multiple scales
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances 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: 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: 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: tryolabs/luminoth
Commit Name: 13de22d42ecbc51ea19bdd571262959eb29804d9
Time: 2017-06-18
Author: javirey@gmail.com
File Name: frcnn/roi_pool.py
Class Name: ROIPoolingLayer
Method Name: _roi_crop