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
def contextual_loss(x, y, h=0.5): | |
"""Computes contextual loss between x and y. | |
Args: | |
x: features of shape (N, C, H, W). | |
y: features of shape (N, C, H, W). | |
Returns: | |
cx_loss = contextual loss between x and y (Eq (1) in the paper) | |
""" |