class_docstr: Defines a classification network from Regressor by specifying the output shape as a single dimensional tensor
  with size equal to the number of classes to predict. The final activation function can also be specified, eg.
  softmax or sigmoid.
  
  Args:
      in_shape: tuple of integers stating the dimension of the input tensor (minus batch dimension)
      classes: integer stating the dimension of the final output tensor
      channels: tuple of integers stating the output channels of each convolutional layer
      strides: tuple of integers stating the stride (downscale factor) of each convolutional layer
      kernel_size: integer or tuple of integers stating size of convolutional kernels
      num_res_units: integer stating number of convolutions in residual units, 0 means no residual units
      act: name or type defining activation layers
      norm: name or type defining normalization layers
      dropout: optional float value in range [0, 1] stating dropout probability for layers, None for no dropout
      bias: boolean stating if convolution layers should have a bias component
      last_act: name defining the last activation layer
class_docstr_tok: ["Defines","a","classification","network","from","Regressor","by","specifying","the","output","shape","as","a","single","dimensional","tensor","with","size","equal","to","the","number","of","classes","to","predict",".","The","final","activation","function","can","also","be","specified",",","eg",".","softmax","or","sigmoid",".","Args",":","in_shape",":","tuple","of","integers","stating","the","dimension","of","the","input","tensor","(","minus","batch","dimension",")","classes",":","integer","stating","the","dimension","of","the","final","output","tensor","channels",":","tuple","of","integers","stating","the","output","channels","of","each","convolutional","layer","strides",":","tuple","of","integers","stating","the","stride","(","downscale","factor",")","of","each","convolutional","layer","kernel_size",":","integer","or","tuple","of","integers","stating","size","of","convolutional","kernels","num_res_units",":","integer","stating","number","of","convolutions","in","residual","units",",","0","means","no","residual","units","act",":","name","or","type","defining","activation","layers","norm",":","name","or","type","defining","normalization","layers","dropout",":","optional","float","value","in","range","[","0",",","1","]","stating","dropout","probability","for","layers",",","None","for","no","dropout","bias",":","boolean","stating","if","convolution","layers","should","have","a","bias","component","last_act",":","name","defining","the","last","activation","layer"]
code: def __init__(
      self,
      in_shape: Sequence[int],
      classes: int,
      channels: Sequence[int],
      strides: Sequence[int],
      kernel_size: Sequence[int] | int = 3,
      num_res_units: int = 2,
      act=Act.PRELU,
      norm=Norm.INSTANCE,
      dropout: float | None = None,
      bias: bool = True,
      last_act: str | None = None,
  ) -> None:
      super().__init__(
          in_shape,
          (classes,),
          channels,
          strides,
          kernel_size,
          num_res_units,
          act,
          norm,
          dropout,
          bias,
      )
  
      if last_act is not None:
          last_act_name, last_act_args = split_args(last_act)
          last_act_type = Act[last_act_name]
  
          self.final.add_module(
              "lastact", last_act_type(**last_act_args)
          )
  
file_path: MONAI/monai/networks/nets/classifier.py
imports: from __future__ import annotations
  from collections.abc import Sequence
  import torch
  import torch.nn
  from monai.networks.layers.factories import Act, Norm, split_args
  from monai.networks.nets.regressor import Regressor
label_desc: Use image node_id 1 to create a new Classifier object from inherited base classes: Regressor with example: obj = Classifier(in_shape, classes, channels, strides, kernel_size, num_res_units, act, norm, dropout, bias, last_act)