class_docstr: Base WideResNet implementation.
docstr: Creates WideResNetGeneral instance.
  
  Args:
      nin: number of channels in the input image.
      nclass: number of output classes.
      blocks_per_group: number of blocks in each block group.
      width: multiplier to the number of convolution filters.
      bn: module which used as batch norm function.
docstr_tok: ["Creates","WideResNetGeneral","instance",".","Args",":","nin",":","number","of","channels","in","the","input","image",".","nclass",":","number","of","output","classes",".","blocks_per_group",":","number","of","blocks","in","each","block","group",".","width",":","multiplier","to","the","number","of","convolution","filters",".","bn",":","module","which","used","as","batch","norm","function","."]
code: def __init__(
      self,
      nin: int,
      nclass: int,
      blocks_per_group: List[int],
      width: int,
      bn: Callable = functools.partial(
          objax.nn.BatchNorm2D, momentum=BN_MOM, eps=BN_EPS
      ),
  ):
      """Creates WideResNetGeneral instance.
  
      Args:
          nin: number of channels in the input image.
          nclass: number of output classes.
          blocks_per_group: number of blocks in each block group.
          width: multiplier to the number of convolution filters.
          bn: module which used as batch norm function.
      """
      widths = [
          int(v * width)
          for v in [16 * (2**i) for i in range(len(blocks_per_group))]
      ]
  
      n = 16
      ops = [objax.nn.Conv2D(nin, n, 3, **conv_args(3, n))]
      for i, (block, width) in enumerate(zip(blocks_per_group, widths)):
          stride = 2 if i > 0 else 1
          ops.append(WRNBlock(n, width, stride, bn))
          for b in range(1, block):
              ops.append(WRNBlock(width, width, 1, bn))
          n = width
      ops += [
          bn(n),
          objax.functional.relu,
          self.mean_reduce,
          objax.nn.Linear(
              n, nclass, w_init=objax.nn.init.xavier_truncated_normal
          ),
      ]
      super().__init__(ops)
  
file_path: objax/objax/zoo/wide_resnet.py
imports: import functools
  from typing import Callable, List
  import objax
  from objax.typing import JaxArray
label_desc: Use image node_id 2 to create a new WideResNetGeneral object from inherited base classes: objax.nn with example: obj = WideResNetGeneral(nin, nclass, blocks_per_group, width, bn)