class_docstr: Class for TabNet model.
class_docstr_tok: ["Class","for","TabNet","model","."]
docstr: Trains one batch of data
  
  Parameters
  ----------
  X : torch.Tensor
      Train matrix
  y : torch.Tensor
      Target matrix
  
  Returns
  -------
  batch_outs : dict
      Dictionnary with "y": target and "score": prediction scores.
  batch_logs : dict
      Dictionnary with "batch_size" and "loss".
docstr_tok: ["Trains","one","batch","of","data","Parameters","--","--","--","--","--","X",":","torch.Tensor","Train","matrix","y",":","torch.Tensor","Target","matrix","Returns","--","--","--","-","batch_outs",":","dict","Dictionnary","with","``","y","''",":","target","and","``","score","''",":","prediction","scores",".","batch_logs",":","dict","Dictionnary","with","``","batch_size","''","and","``","loss","''","."]
code: def _train_batch(self, X, y):
      """
      Trains one batch of data
  
      Parameters
      ----------
      X : torch.Tensor
          Train matrix
      y : torch.Tensor
          Target matrix
  
      Returns
      -------
      batch_outs : dict
          Dictionnary with "y": target and "score": prediction scores.
      batch_logs : dict
          Dictionnary with "batch_size" and "loss".
      """
      batch_logs = {"batch_size": X.shape[0]}
  
      X = X.to(self.device).float()
      y = y.to(self.device).float()
  
      if self.augmentations is not None:
          X, y = self.augmentations(X, y)
  
      for param in self.network.parameters():
          param.grad = None
  
      output, M_loss = self.network(X)
  
      loss = self.compute_loss(output, y)
      # Add the overall sparsity loss
      loss = loss - self.lambda_sparse * M_loss
  
      # Perform backward pass and optimization
      loss.backward()
      if self.clip_value:
          clip_grad_norm_(self.network.parameters(), self.clip_value)
      self._optimizer.step()
  
      batch_logs["loss"] = loss.cpu().detach().numpy().item()
  
      return batch_logs
  
imports: from dataclasses import dataclass, field
  from typing import List, Any, Dict
  import torch
  from torch.nn.utils import clip_grad_norm_
  import numpy
  from scipy.sparse import csc_matrix
  from abc import abstractmethod
  from pytorch_tabnet import tab_network
  from pytorch_tabnet.utils import SparsePredictDataset, PredictDataset, create_explain_matrix, validate_eval_set, create_dataloaders, define_device, ComplexEncoder, check_input, check_warm_start, create_group_matrix, check_embedding_parameters
  from pytorch_tabnet.callbacks import CallbackContainer, History, EarlyStopping, LRSchedulerCallback
  from pytorch_tabnet.metrics import MetricContainer, check_metrics
  from sklearn.base import BaseEstimator
  from torch.utils.data import DataLoader
  import io
  import json
  from pathlib import Path
  import shutil
  import zipfile
  import warnings
  import copy
  import scipy
label_desc: Use image node_id 11 for calling the TabModel obj's underlying member method code with example usage: obj._train_batch(X, y) and returns: batch_logs