docstr: Fits the Neural mixer on some data, making it ready to predict
  
  :param train_data: The network is fit/trained on this
  :param dev_data: Data used for early stopping and hyperparameter determination
code: def _fit(self, train_data: EncodedDs, dev_data: EncodedDs) -> None:
      """
      Fits the Neural mixer on some data, making it ready to predict
  
      :param train_data: The network is fit/trained on this
      :param dev_data: Data used for early stopping and hyperparameter determination
      """
      # ConcatedEncodedDs
      self.started = time.time()
      self.batch_size = min(200, int(len(train_data) / 10))
      self.batch_size = max(40, self.batch_size)
  
      dev_dl = DataLoader(
          dev_data, batch_size=self.batch_size, shuffle=False
      )
      train_dl = DataLoader(
          train_data, batch_size=self.batch_size, shuffle=False
      )
  
      # Find learning rate & keep initial weights
      self._init_net(train_data)
      if not self.lr:
          self.lr, self.model = self._find_lr(train_data)
  
      # Keep on training
      optimizer = self._select_optimizer(self.model, lr=self.lr)
      criterion = self._select_criterion()
      scaler = GradScaler()
  
      # Only 0.8 of the remaining time budget is used to allow some time for the final tuning and partial fit
      self.model, epoch_to_best_model, _ = self._max_fit(
          train_dl,
          dev_dl,
          criterion,
          optimizer,
          scaler,
          (self.stop_after - (time.time() - self.started)) * 0.8,
          return_model_after=20000,
      )
  
      self.epochs_to_best += epoch_to_best_model
  
      if self.fit_on_dev:
          self.partial_fit(dev_data, train_data)
  
imports: import time
  from copy import deepcopy
  from collections import deque
  from typing import Dict, List, Optional
  import torch
  import numpy
  import pandas
  from torch import nn
  import torch_optimizer
  from sklearn.metrics import r2_score
  from torch.cuda.amp import GradScaler
  from torch.utils.data import DataLoader
  from torch.nn.modules.loss import MSELoss
  from torch.optim.optimizer import Optimizer
  from type_infer.dtype import dtype
  from lightwood.helpers.log import log
  from lightwood.encoder.base import BaseEncoder
  from lightwood.helpers.torch import LightwoodAutocast
  from lightwood.data.encoded_ds import EncodedDs
  from lightwood.mixer.base import BaseMixer
  from lightwood.mixer.helpers.ar_net import ArNet
  from lightwood.mixer.helpers.default_net import DefaultNet
  from lightwood.api.types import PredictionArguments
  from lightwood.mixer.helpers.transform_corss_entropy_loss import TransformCrossEntropyLoss
label_desc: Use image node_id 10 for calling the Neural obj's underlying member method code with example usage: obj._fit(train_data, dev_data) without return types