Exemplo n.º 1
0
 def fourier_l2(y_true, y_pred):
     y_true_fourier = utils.convert_tensor_to_frequency_domain(
         y_true)
     y_pred_fourier = utils.convert_tensor_to_frequency_domain(
         y_pred)
     y_true = utils.join_reim_tensor(y_true_fourier)
     y_pred = utils.join_reim_tensor(y_pred_fourier)
     return K.mean(K.pow(K.abs(y_true - y_pred), 2))
Exemplo n.º 2
0
 def image_l1(y_true, y_pred):
     y_true_fourier = utils.convert_tensor_to_image_domain(
         tf.signal.ifftshift(y_true, axes=(1, 2)))
     y_pred_fourier = utils.convert_tensor_to_image_domain(
         tf.signal.ifftshift(y_pred, axes=(1, 2)))
     return K.mean(
         K.abs(
             K.abs(utils.join_reim_tensor(y_true_fourier)) -
             K.abs(utils.join_reim_tensor(y_pred_fourier))))
Exemplo n.º 3
0
def join_reim_mag_output(tensor):
    """

    Args:
      tensor: Tensor of shape (batch_size, n, n, 2)

    Returns:
      Tensor of shape (batch_size, n, n) with joined real and imag parts

    """
    return tf.expand_dims(K.abs(utils.join_reim_tensor(tensor)), -1)
Exemplo n.º 4
0
 def image_l1(y_true, y_pred):
     return K.mean(
         K.abs(
             K.abs(utils.join_reim_tensor(y_true)) -
             K.abs(utils.join_reim_tensor(y_pred))))