import numpy as np
import torch
from logger import Logger
LOGGER = Logger().logger()
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")

#Author: @meetdoshi
class Loss:
    @staticmethod
    def adversarial_G():
        '''
        @params
        @return
        '''
        return torch.nn.MSELoss().to(device)

    @staticmethod
    def cycle_consistency():
        '''
        @params
        @return
        '''
        return torch.nn.L1Loss().to(device)

    @staticmethod
    def identity():
        '''
        @params
        @return
        '''
        return torch.nn.L1Loss().to(device)

    @staticmethod
    def total_loss(lamda=10):
        '''
        @params
        @return
        '''
        return Loss.adversarial_G() + Loss.adversarial_D() + lamda*Loss.cycle_consistency() 