code: def create_network(stage_depth):
      if stage_depth in (18, 18):
          stages = (2, 2, 2, 2)
      elif stage_depth in (34, 50):
          stages = (3, 4, 6, 3)
      elif stage_depth in (68, 101):
          stages = (3, 4, 23, 3)
      elif stage_depth in (102, 152):
          stages = (3, 8, 36, 3)
      else:
          raise ValueError(
              "Invalid stage_depth value".format(stage_depth)
          )
  
      bottleneck = False
      if stage_depth in (50, 101, 152):
          bottleneck = True
  
      layers = [
          Conv(**conv_params(7, 64, strides=2)),
          Pooling(3, strides=2),
      ]
  
      # Structure of the deep residual part of the network:
      # stage_depth modules of 2 convolutional layers each at feature map depths
      # of 64, 128, 256, 512
      nfms = list(
          itt.chain.from_iterable(
              [
                  itt.repeat(2 ** (x + 6), r)
                  for x, r in enumerate(stages)
              ]
          )
      )
      strides = [-1] + [
          1 if cur == prev else 2
          for cur, prev in zip(nfms[1:], nfms[:-1])
      ]
  
      for nfm, stride in zip(nfms, strides):
          layers.append(module_factory(nfm, bottleneck, stride))
  
      layers.append(Pooling("all", op="avg"))
      layers.append(Conv(**conv_params(1, 1000, relu=False)))
      layers.append(Activation(Softmax()))
      return Model(layers=layers), GeneralizedCost(
          costfunc=CrossEntropyMulti()
      )
  
file_path: neon/examples/imagenet/network_msra.py
imports: from builtins import zip
  import itertools
  from neon.initializers import Kaiming
  from neon.layers import Conv, Pooling, GeneralizedCost, Activation
  from neon.layers import MergeSum, SkipNode
  from neon.transforms import Rectlin, Softmax, CrossEntropyMulti
  from neon.models import Model
label_desc: Use image node_id 3 for calling a global function with example usage: create_network(stage_depth) and returns: Model,  GeneralizedCost