Exemplo n.º 1
0
 def __init__(self, k1=0.01, k2=0.03, kernel_size=3, max_value=1.0):
     self.__name__ = 'DSSIMObjective'
     self.kernel_size = kernel_size
     self.k1 = k1
     self.k2 = k2
     self.max_value = max_value
     self.c1 = (self.k1 * self.max_value)**2
     self.c2 = (self.k2 * self.max_value)**2
     self.dim_ordering = K.image_data_format()
     self.backend = KC.backend()
Exemplo n.º 2
0
    def __init__(self, k1=0.01, k2=0.03, kernel_size=3, max_value=1.0):
        """
        Difference of Structural Similarity (DSSIM loss function). Clipped between 0 and 0.5
        Note : You should add a regularization term like a l2 loss in addition to this one.

        # Arguments
            k1: Parameter of the SSIM (default 0.01)
            k2: Parameter of the SSIM (default 0.03)
            kernel_size: Size of the sliding window (default 3)
            max_value: Max value of the output (default 1.0)
        """
        self.__name__ = 'DSSIMObjective'
        self.kernel_size = kernel_size
        self.k1 = k1
        self.k2 = k2
        self.max_value = max_value
        self.c1 = (self.k1 * self.max_value)**2
        self.c2 = (self.k2 * self.max_value)**2
        self.dim_ordering = K.image_dim_ordering()
        self.backend = KC.backend()
Exemplo n.º 3
0
def int_shape(x):
    return KC.int_shape(x) if KC.backend() == 'tensorflow' else KC.shape(x)