class_docstr: A fully connected network for multitask classification.
  
  This class provides lots of options for customizing aspects of the model: the
  number and widths of layers, the activation functions, regularization methods,
  etc.
  
  It optionally can compose the model from pre-activation residual blocks, as
  described in https://arxiv.org/abs/1603.05027, rather than a simple stack of
  dense layers.  This often leads to easier training, especially when using a
  large number of layers.  Note that residual blocks can only be used when
  successive layers have the same width.  Wherever the layer width changes, a
  simple dense layer will be used even if residual=True.
class_docstr_tok: ["A","fully","connected","network","for","multitask","classification",".","This","class","provides","lots","of","options","for","customizing","aspects","of","the","model",":","the","number","and","widths","of","layers",",","the","activation","functions",",","regularization","methods",",","etc",".","It","optionally","can","compose","the","model","from","pre-activation","residual","blocks",",","as","described","in","https",":","\/\/arxiv.org\/abs\/1603.05027",",","rather","than","a","simple","stack","of","dense","layers",".","This","often","leads","to","easier","training",",","especially","when","using","a","large","number","of","layers",".","Note","that","residual","blocks","can","only","be","used","when","successive","layers","have","the","same","width",".","Wherever","the","layer","width","changes",",","a","simple","dense","layer","will","be","used","even","if","residual=True","."]
code: def default_generator(
      self,
      dataset: dc.data.Dataset,
      epochs: int = 1,
      mode: str = "fit",
      deterministic: bool = True,
      pad_batches: bool = True,
  ) -> Iterable[Tuple[List, List, List]]:
      for epoch in range(epochs):
          for X_b, y_b, w_b, ids_b in dataset.iterbatches(
              batch_size=self.batch_size,
              deterministic=deterministic,
              pad_batches=pad_batches,
          ):
              if y_b is not None:
                  y_b = to_one_hot(
                      y_b.flatten(), self.n_classes
                  ).reshape(-1, self.n_tasks, self.n_classes)
              yield ([X_b], [y_b], [w_b])
  
imports: import logging
  import numpy
  import torch
  import torch.nn.functional
  from collections.abc import Sequence
  import deepchem
  from deepchem.models.torch_models.torch_model import TorchModel
  from deepchem.models.losses import _make_pytorch_shapes_consistent
  from deepchem.metrics import to_one_hot
  from typing import Any, Callable, Iterable, List, Optional, Sequence, Tuple, Union
  from deepchem.utils.typing import ActivationFn, LossFn, OneOrMany
  from deepchem.utils.pytorch_utils import get_activation
label_desc: Use image node_id 2 for calling the MultitaskClassifier obj's underlying member method code with example usage: obj.default_generator(dataset, epochs, mode, deterministic, pad_batches) without return types