HiLab-git / PyMIC

Apache License 2.0
347 stars 53 forks source link

Update agent_seg.py #19

Closed vincentme closed 3 years ago

vincentme commented 3 years ago

Add the functionality of setting config['training']['loss_type'] as a list of loss_type string with the new configuration of config['training']['loss_weight'] to indicate the corresponding weight for each loss function. In this way, the combined loss is easier to implement than manually define. This code is also back compatible with previous style.

An example of config is config.training.loss_type = ['DiceLoss', 'CrossEntropyLoss'] config.training.loss_weight = [1., 1.]