models/Transformer/class_wrapper.py
def make_loss(self, logit=None, labels=None, G=None):
        """
        Create a tensor that represents the loss. This is consistant both at training time \
        and inference time for Backward model
        :param logit: The output of the network, the predicted geometry
        :param labels: The ground truth labels, the Truth geometry
        :param boundary: The boolean flag indicating adding boundary loss or not
        :param z_log_var: The log variance for VAE kl_loss
        :param z_mean: The z mean vector for VAE kl_loss
        :return: the total loss
        """
        MSE_loss = nn.functional.mse_loss(logit, labels, reduction='mean')          # The MSE Loss
        BDY_loss = 0
        if G is not None:         # This is using the boundary loss
            X_range, X_lower_bound, X_upper_bound = self.get_boundary_lower_bound_uper_bound()
            X_mean = (X_lower_bound + X_upper_bound) / 2        # Get the mean
            relu = torch.nn.ReLU()
            BDY_loss_all = 1 * relu(torch.abs(G - self.build_tensor(X_mean)) - 0.5 * self.build_tensor(X_range))
        self.MSE_loss = MSE_loss
        self.Boundary_loss = BDY_loss
        return torch.add(MSE_loss, BDY_loss)

        Create a tensor that represents the loss. This is consistant both at training time \
        and inference time for Backward model
        :param logit: The output of the network, the predicted geometry
        :param labels: The ground truth labels, the Truth geometry
        :param boundary: The boolean flag indicating adding boundary loss or not
        :param z_log_var: The log variance for VAE kl_loss
        :param z_mean: The z mean vector for VAE kl_loss
        :return: the total loss
        
Create a tensor that represents the loss. This is consistant both at training time \
and inference time for Backward model
Create a tensor that represents the loss . This is consistant both at training time \ and inference time for Backward model
def make_loss(self, logit=None, labels=None, G=None):
        MSE_loss = nn.functional.mse_loss(logit, labels, reduction='mean')          
        BDY_loss = 0
        if G is not None:         
            X_range, X_lower_bound, X_upper_bound = self.get_boundary_lower_bound_uper_bound()
            X_mean = (X_lower_bound + X_upper_bound) / 2        
            relu = torch.nn.ReLU()
            BDY_loss_all = 1 * relu(torch.abs(G - self.build_tensor(X_mean)) - 0.5 * self.build_tensor(X_range))
        self.MSE_loss = MSE_loss
        self.Boundary_loss = BDY_loss
        return torch.add(MSE_loss, BDY_loss)
def make_loss ( self , logit = None , labels = None , G = None ) : MSE_loss = nn . functional . mse_loss ( logit , labels , reduction = 'mean' ) BDY_loss = 0 if G is not None : X_range , X_lower_bound , X_upper_bound = self . get_boundary_lower_bound_uper_bound ( ) X_mean = ( X_lower_bound + X_upper_bound ) / 2 relu = torch . nn . ReLU ( ) BDY_loss_all = 1 * relu ( torch . abs ( G - self . build_tensor ( X_mean ) ) - 0.5 * self . build_tensor ( X_range ) ) self . MSE_loss = MSE_loss self . Boundary_loss = BDY_loss return torch . add ( MSE_loss , BDY_loss )
Create a tensor that represents the loss.
Create a tensor that represents the loss .
"""
        Create a tensor that represents the loss. This is consistant both at training time \
        and inference time for Backward model
        :param logit: The output of the network, the predicted geometry
        :param labels: The ground truth labels, the Truth geometry
        :param boundary: The boolean flag indicating adding boundary loss or not
        :param z_log_var: The log variance for VAE kl_loss
        :param z_mean: The z mean vector for VAE kl_loss
        :return: the total loss
        """ # The MSE Loss
 # This is using the boundary loss
 # Get the mean

the total loss
the total loss
self
logit
The output of the network, the predicted geometry
The output of the network the predicted geometry
labels
The ground truth labels, the Truth geometry
The ground truth labels the Truth geometry
G
boundary
The boolean flag indicating adding boundary loss or not
The boolean flag indicating adding boundary loss or not
z_log_var
The log variance for VAE kl_loss
The log variance for VAE kl_loss
z_mean
The z mean vector for VAE kl_loss
The z mean vector for VAE kl_loss