class_docstr: A pre-trained CNN model with 101 layers provided by MSRA.
  
  When you specify the path of the pre-trained chainer model serialized as
  a ``.npz`` file in the constructor, this chain model automatically
  initializes all the parameters with it.
  This model would be useful when you want to extract a semantic feature
  vector per image, or fine-tune the model on a different dataset.
  Note that unlike ``VGG16Layers``, it does not automatically download a
  pre-trained caffemodel. This caffemodel can be downloaded at
  `GitHub <https://github.com/KaimingHe/deep-residual-networks>`_.
  
  If you want to manually convert the pre-trained caffemodel to a chainer
  model that can be specified in the constructor,
  please use ``convert_caffemodel_to_npz`` classmethod instead.
  
  ResNet101 has 44,549,224 trainable parameters, and it's 43% fewer than
  ResNet152 model, while the top-5 classification accuracy on ImageNet
  dataset drops 1.1% from ResNet152. For many cases, ResNet50 may have the
  best balance between the accuracy and the model size.
  
  See: K. He et. al., `Deep Residual Learning for Image Recognition
  <https://arxiv.org/abs/1512.03385>`_
  
  Args:
      pretrained_model (str): the destination of the pre-trained
          chainer model serialized as a ``.npz`` file.
          If this argument is specified as ``auto``,
          it automatically loads and converts the caffemodel from
          ``$CHAINER_DATASET_ROOT/pfnet/chainer/models/ResNet-101-model.caffemodel``,
          where ``$CHAINER_DATASET_ROOT`` is set as
          ``$HOME/.chainer/dataset`` unless you specify another value
          by modifying the environment variable. Note that in this case the
          converted chainer model is stored on the same directory and
          automatically used from the next time.
          If this argument is specified as ``None``, all the parameters
          are not initialized by the pre-trained model, but the default
          initializer used in the original paper, i.e.,
          ``chainer.initializers.HeNormal(scale=1.0)``.
      downsample_fb (bool): If this argument is specified as ``False``,
          it performs downsampling by placing stride 2
          on the 1x1 convolutional layers (the original MSRA ResNet).
          If this argument is specified as ``True``, it performs downsampling
          by placing stride 2 on the 3x3 convolutional layers
          (Facebook ResNet).
  
  Attributes:
      available_layers (list of str): The list of available layer names
          used by ``forward`` and ``extract`` methods.
class_docstr_tok: ["A","pre-trained","CNN","model","with","101","layers","provided","by","MSRA",".","When","you","specify","the","path","of","the","pre-trained","chainer","model","serialized","as","a","``",".npz","``","file","in","the","constructor",",","this","chain","model","automatically","initializes","all","the","parameters","with","it",".","This","model","would","be","useful","when","you","want","to","extract","a","semantic","feature","vector","per","image",",","or","fine-tune","the","model","on","a","different","dataset",".","Note","that","unlike","``","VGG16Layers","``",",","it","does","not","automatically","download","a","pre-trained","caffemodel",".","This","caffemodel","can","be","downloaded","at","`","GitHub","<","https",":","\/\/github.com\/KaimingHe\/deep-residual-networks",">","`","_",".","If","you","want","to","manually","convert","the","pre-trained","caffemodel","to","a","chainer","model","that","can","be","specified","in","the","constructor",",","please","use","``","convert_caffemodel_to_npz","``","classmethod","instead",".","ResNet101","has","44,549,224","trainable","parameters",",","and","it","'s","43","%","fewer","than","ResNet152","model",",","while","the","top-5","classification","accuracy","on","ImageNet","dataset","drops","1.1","%","from","ResNet152",".","For","many","cases",",","ResNet50","may","have","the","best","balance","between","the","accuracy","and","the","model","size",".","See",":","K.","He","et",".","al.",",","`","Deep","Residual","Learning","for","Image","Recognition","<","https",":","\/\/arxiv.org\/abs\/1512.03385",">","`","_","Args",":","pretrained_model","(","str",")",":","the","destination","of","the","pre-trained","chainer","model","serialized","as","a","``",".npz","``","file",".","If","this","argument","is","specified","as","``","auto","``",",","it","automatically","loads","and","converts","the","caffemodel","from","``","$","CHAINER_DATASET_ROOT\/pfnet\/chainer\/models\/ResNet-101-model.caffemodel","``",",","where","``","$","CHAINER_DATASET_ROOT","``","is","set","as","``","$","HOME\/.chainer\/dataset","``","unless","you","specify","another","value","by","modifying","the","environment","variable",".","Note","that","in","this","case","the","converted","chainer","model","is","stored","on","the","same","directory","and","automatically","used","from","the","next","time",".","If","this","argument","is","specified","as","``","None","``",",","all","the","parameters","are","not","initialized","by","the","pre-trained","model",",","but","the","default","initializer","used","in","the","original","paper",",","i.e.",",","``","chainer.initializers.HeNormal","(","scale=1.0",")","``",".","downsample_fb","(","bool",")",":","If","this","argument","is","specified","as","``","False","``",",","it","performs","downsampling","by","placing","stride","2","on","the","1x1","convolutional","layers","(","the","original","MSRA","ResNet",")",".","If","this","argument","is","specified","as","``","True","``",",","it","performs","downsampling","by","placing","stride","2","on","the","3x3","convolutional","layers","(","Facebook","ResNet",")",".","Attributes",":","available_layers","(","list","of","str",")",":","The","list","of","available","layer","names","used","by","``","forward","``","and","``","extract","``","methods","."]
code: def __init__(self, pretrained_model="auto", downsample_fb=False):
      if pretrained_model == "auto":
          pretrained_model = "ResNet-101-model.caffemodel"
      super(ResNet101Layers, self).__init__(
          pretrained_model, 101, downsample_fb
      )
  
imports: import collections
  import os
  import sys
  import warnings
  import numpy
  import chainer
  from chainer.dataset.convert import concat_examples
  from chainer.dataset import download
  from chainer import function
  from chainer.functions.activation.relu import relu
  from chainer.functions.activation.softmax import softmax
  from chainer.functions.array.reshape import reshape
  from chainer.functions.math.sum import sum
  from chainer.functions.pooling.average_pooling_2d import average_pooling_2d
  from chainer.functions.pooling.max_pooling_nd import max_pooling_2d
  from chainer.initializers import constant
  from chainer.initializers import normal
  from chainer import link
  from chainer.links.connection.convolution_2d import Convolution2D
  from chainer.links.connection.linear import Linear
  from chainer.links.normalization.batch_normalization import BatchNormalization
  from chainer.serializers import npz
  from chainer.utils import argument
  from chainer.utils import imgproc
  from chainer.variable import Variable
label_desc: Use image node_id 1 to create a new ResNet101Layers object from inherited base classes: ResNetLayers with example: obj = ResNet101Layers(pretrained_model, downsample_fb)