Created
          June 12, 2019 22:25 
        
      - 
      
- 
        Save stiv-yakovenko/cb8ad7e9a2e922f23c44b04777c5aa02 to your computer and use it in GitHub Desktop. 
    bce+dice
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | smooth = 1. | |
| intersection = tf.reduce_sum(flat_logits * flat_labels) | |
| dice_score = (2 * intersection + smooth) / ( | |
| tf.reduce_sum(flat_labels) + tf.reduce_sum(flat_logits) + smooth) | |
| dice_loss = 1 - dice_score | |
| cross_entropy_loss = tf.reduce_mean( | |
| tf.nn.softmax_cross_entropy_with_logits_v2(logits=flat_logits, labels=flat_labels)) | |
| loss = dice_loss + cross_entropy_loss | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment