def __init__(self, configuration):
    'Initialize the model.\n        '
    super().__init__(configuration)
    self.loss_names = ['segmentation']
    self.network_names = ['unet']
    self.netunet = UNet(1, 2)
    self.netunet = self.netunet.to(self.device)
    if self.is_train:
        self.criterion_loss = torch.nn.CrossEntropyLoss()
        self.optimizer = torch.optim.Adam(self.netunet.parameters(), lr=configuration['lr'])
        self.optimizers = [self.optimizer]
    self.val_predictions = []
    self.val_labels = []
    self.val_images = []
Initialize the model.
def __init__(self, configuration):
    '\n        '
    super().__init__(configuration)
    self.loss_names = ['segmentation']
    self.network_names = ['unet']
    self.netunet = UNet(1, 2)
    self.netunet = self.netunet.to(self.device)
    if self.is_train:
        self.criterion_loss = torch.nn.CrossEntropyLoss()
        self.optimizer = torch.optim.Adam(self.netunet.parameters(), lr=configuration['lr'])
        self.optimizers = [self.optimizer]
    self.val_predictions = []
    self.val_labels = []
    self.val_images = []