def get_loss_score(model, val_loader, criterion, device):
    model.eval()
    epoch_valid_loss = 0
    y_pred_list = []
    y_true_list = []
    output_sig_list = []
    lwlrap_val = 0
    for (batch_idx, (data, target)) in enumerate(val_loader):
        (data, target) = (data.to(device), target.to(device))
        output = model(data)
        loss = criterion(output, target)
        epoch_valid_loss += (loss.item() * data.size(0))
        output_ = output['output']
        output_sig = output['output_sigmoid']
        output_sig = output_sig.detach().cpu().numpy()
        _y_pred = output_.detach().cpu().numpy().argmax(axis=1)
        _y_true = target.detach().cpu().numpy().argmax(axis=1)
        y_pred_list.append(_y_pred)
        y_true_list.append(_y_true)
        output_sig_list.append(output_sig)
        lwlrap_val += (U.LWLRAP(output_, target) / len(val_loader))
    loss_val = (epoch_valid_loss / len(val_loader.dataset))
    y_pred = np.concatenate(y_pred_list, axis=0)
    y_true = np.concatenate(y_true_list, axis=0)
    output_sig = np.concatenate(output_sig_list, axis=0)
    acc_val = accuracy_score(y_true, y_pred)
    del data
    return (loss_val, acc_val, lwlrap_val, output_sig)
def get_loss_score(model, val_loader, criterion, device):
    model.eval()
    epoch_valid_loss = 0
    y_pred_list = []
    y_true_list = []
    output_sig_list = []
    lwlrap_val = 0
    for (batch_idx, (data, target)) in enumerate(val_loader):
        (data, target) = (data.to(device), target.to(device))
        output = model(data)
        loss = criterion(output, target)
        epoch_valid_loss += (loss.item() * data.size(0))
        output_ = output['output']
        output_sig = output['output_sigmoid']
        output_sig = output_sig.detach().cpu().numpy()
        _y_pred = output_.detach().cpu().numpy().argmax(axis=1)
        _y_true = target.detach().cpu().numpy().argmax(axis=1)
        y_pred_list.append(_y_pred)
        y_true_list.append(_y_true)
        output_sig_list.append(output_sig)
        lwlrap_val += (U.LWLRAP(output_, target) / len(val_loader))
    loss_val = (epoch_valid_loss / len(val_loader.dataset))
    y_pred = np.concatenate(y_pred_list, axis=0)
    y_true = np.concatenate(y_true_list, axis=0)
    output_sig = np.concatenate(output_sig_list, axis=0)
    acc_val = accuracy_score(y_true, y_pred)
    del data
    return (loss_val, acc_val, lwlrap_val, output_sig)