niftynet.layer.loss_classification module¶
Loss functions for multi-class classification
-
class
LossFunction
(n_class, loss_type='CrossEntropy', loss_func_params=None, name='loss_function')[source]¶ Bases:
niftynet.layer.base_layer.Layer
-
layer_op
(prediction, ground_truth=None, var_scope=None)[source]¶ Compute loss from prediction and ground truth,
if prediction `is list of tensors, each element of the list will be compared against `ground_truth.
Parameters: - prediction – input will be reshaped into (N, num_classes)
- ground_truth – input will be reshaped into (N,)
- var_scope –
Returns:
-