Skip to content

Loss function discrepancy ? #1

@kalyan-allada

Description

@kalyan-allada

Thanks for the deeptriangle python code!

Isn't your loss function slightly different than what the deep triangle paper suggested in equation 18 ?

def custom_mse(y_true, y_pred): 
      # assume 1st dimension is the number of samples        
      keep= tfk.cast(tfk.not_equal(y_true, missing_value), tfk.floatx())        
      mse = tfk.mean(tfk.square((y_pred-y_true)*keep), axis=2)
      return mse

from what I understand from the paper, loss function should be :

def custom_mse(y_true, y_pred):
        keep= tfk.cast(tfk.not_equal(y_true, missing_value), tfk.floatx()) 
        sum_squared_error = tfk.sum(tfk.square((y_pred-y_true)*keep), axis=1)
        mse = sum_squared_error/tfk.sum(keep, axis=1)
        return mse

Is there a reason why you do mse = tfk.mean(tfk.square((y_pred-y_true)*keep), axis=2) ? Or am I missing something here ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions