from losses.confusion_loss import confusion_loss

from losses.dice_loss import dice_loss

import torch.optim as optim
from train_utils_segmentation import train_encoder_domain_unlearn_semi, val_encoder_domain_unlearn_semi, train_unlearn_semi, val_unlearn_semi

import sys
########################################################################################################################
# Create an args class
args = Args()
args.channels_first = True
args.epochs = 300
args.batch_size = 4
args.diff_model_flag = False
args.alpha = 50
args.patience = 100

cuda = torch.cuda.is_available()

LOAD_PATH_UNET = None
LOAD_PATH_SEGMENTER = None
LOAD_PATH_DOMAIN = None

PRETRAIN_UNET = 'pretrain_unet'
PATH_UNET = 'unet_pth'
CHK_PATH_UNET = 'unet_pth_checkpoint'
PATH_SEGMENTER = 'segmenter_pth'
CHK_PATH_SEGMENTER = 'segmenter_pth_checkpoint'
PRETRAIN_SEGMENTER = 'pretrain_segmenter'
PATH_DOMAIN = 'domain_pth'
Exemplo n.º 2
0
import numpy as np
from sklearn.utils import shuffle
from utils import Args, EarlyStopping_unlearning
from losses.confusion_loss import confusion_loss
import torch.optim as optim
from train_utils import train_unlearn_distinct, val_unlearn_distinct, val_encoder_domain_unlearn_distinct, train_encoder_domain_unlearn_distinct
import sys

########################################################################################################################
# Create an args class
args = Args()
args.channels_first = True
args.epochs = 300
args.batch_size = 16
args.diff_model_flag = False
args.alpha = 1
args.patience = 150
args.learning_rate = 1e-4

LOAD_PATH_ENCODER = None
LOAD_PATH_REGRESSOR = None
LOAD_PATH_DOMAIN = None

PRE_TRAIN_ENCODER = 'pretrain_encoder'
PATH_ENCODER = 'encoder_pth'
CHK_PATH_ENCODER = 'encoder_chk_pth'
PRE_TRAIN_REGRESSOR = 'pretrain_regressor'
PATH_REGRESSOR = 'regressor_pth'
CHK_PATH_REGRESSOR = 'regressor_chk_pth'
PRE_TRAIN_DOMAIN = 'pretrain_domain'
PATH_DOMAIN = 'domain_pth'