CutMix and MixUp based on the SAINT paper
The history saving thread hit an unexpected error (DatabaseError('database disk image is malformed')).History will not be written to the database.
/mnt/d/lib/python3.7/site-packages/torch/cuda/__init__.py:52: UserWarning: CUDA initialization: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx (Triggered internally at  /pytorch/c10/cuda/CUDAFunctions.cpp:100.)
  return torch._C._cuda_getDeviceCount() > 0

Masking

embed_data_mask[source]

embed_data_mask(x_cat:Tensor, x_cont:Tensor, cat_mask:Tensor, cont_mask:Tensor, net, vision_dset=False)

Embed and mask the data through the embeddings with MLP attention

Function Arguments:

  • x_cat (torch.Tensor): Input categorical features
  • x_cont (torch.Tensor): Input continouous features
  • cat_mask (torch.Tensor): Mask of categorical inputs
  • cont_mask (torch.Tensor): Mask of continouous inputs
  • net: The SAINT architecture
  • vision_dset: Is the dataset a vision dataset

CutMix and MixUp

SAINTMixUp[source]

SAINTMixUp(x1:Tensor, x2:Tensor, lam:float=1, y:Tensor=None, use_cuda:bool=True)

Mixing up inputs, and returning a pair of targets

Function Arguments:

  • x1 (torch.Tensor): One tensor in a batch
  • x2 (torch.Tensor): Another random tensor in a batch
  • lam (float): Lambda to apply on inputs
  • y (torch.Tensor): Targets
  • use_cuda (bool): Whether to perform action on the GPU

SAINTCutMix[source]

SAINTCutMix(x_cat:Tensor, x_cont:Tensor, lam:float=0.1)

Applies CutMix on the x's, noisifying the data

Function Arguments:

  • x_cat (torch.Tensor): One batch of categorical data
  • x_cont (torch.Tensor): One batch of continuous data
  • lam (float): Lambda to apply on inputs
s