class_docstr: SSD model is like a Tree, except with additional handling for the output layer, and
  for the prior boxes
class_docstr_tok: ["SSD","model","is","like","a","Tree",",","except","with","additional","handling","for","the","output","layer",",","and","for","the","prior","boxes"]
code: def generate_layers(self):
      conv_params = {
          "strides": 1,
          "padding": 1,
          "init": Xavier(local=True),
          "bias": Constant(0),
          "activation": Rectlin(),
      }
  
      params = {
          "init": Xavier(local=True),
          "bias": Constant(0),
          "activation": Rectlin(),
      }
  
      # Set up the model layers
      trunk_layers = []
  
      # set up 3x3 conv stacks with different feature map sizes
      # use same names as Caffe model for comparison purposes
      trunk_layers.append(
          Conv((3, 3, 64), name="conv1_1", **conv_params)
      )  # conv1_1
      trunk_layers.append(
          Conv((3, 3, 64), name="conv1_2", **conv_params)
      )
      trunk_layers.append(Pooling(2, strides=2))
      trunk_layers.append(
          Conv((3, 3, 128), name="conv2_1", **conv_params)
      )  # conv2_1
      trunk_layers.append(
          Conv((3, 3, 128), name="conv2_2", **conv_params)
      )
      trunk_layers.append(Pooling(2, strides=2))
      trunk_layers.append(
          Conv((3, 3, 256), name="conv3_1", **conv_params)
      )  # conv3_1
      trunk_layers.append(
          Conv((3, 3, 256), name="conv3_2", **conv_params)
      )
      trunk_layers.append(
          Conv((3, 3, 256), name="conv3_3", **conv_params)
      )
      trunk_layers.append(Pooling(2, strides=2))
      trunk_layers.append(
          Conv((3, 3, 512), name="conv4_1", **conv_params)
      )  # conv4_1
      trunk_layers.append(
          Conv((3, 3, 512), name="conv4_2", **conv_params)
      )
      trunk_layers.append(
          Conv((3, 3, 512), name="conv4_3", **conv_params)
      )
  
      trunk_layers.append(Pooling(2, strides=2))
      trunk_layers.append(
          Conv((3, 3, 512), name="conv5_1", **conv_params)
      )  # conv5_1
      trunk_layers.append(
          Conv((3, 3, 512), name="conv5_2", **conv_params)
      )
      trunk_layers.append(
          Conv((3, 3, 512), name="conv5_3", **conv_params)
      )
      trunk_layers.append(Pooling(3, strides=1, padding=1))
      trunk_layers.append(
          Conv(
              (3, 3, 1024), dilation=6, padding=6, name="fc6", **params
          )
      )  # fc6
      trunk_layers.append(
          Conv(
              (1, 1, 1024), dilation=1, padding=0, name="fc7", **params
          )
      )  # fc7
  
      trunk_layers.append(
          Conv(
              (1, 1, 256),
              strides=1,
              padding=0,
              name="conv6_1",
              **params,
          )
      )
      trunk_layers.append(
          Conv(
              (3, 3, 512),
              strides=2,
              padding=1,
              name="conv6_2",
              **params,
          )
      )
  
      trunk_layers.append(
          Conv(
              (1, 1, 128),
              strides=1,
              padding=0,
              name="conv7_1",
              **params,
          )
      )
      trunk_layers.append(
          Conv(
              (3, 3, 256),
              strides=2,
              padding=1,
              name="conv7_2",
              **params,
          )
      )
  
      # append conv8, conv9, conv10, etc. (if needed)
      matches = [
          re.search("conv(\d+)_2", key) for key in self.ssd_config
      ]
      layer_nums = [
          int(m.group(1)) if m is not None else -1 for m in matches
      ]
      max_layer_num = np.max(layer_nums)
  
      if max_layer_num is not None:
          for layer_num in range(8, max_layer_num + 1):
              trunk_layers.append(
                  Conv(
                      (1, 1, 128),
                      strides=1,
                      padding=0,
                      name="conv{}_1".format(layer_num),
                      **params,
                  )
              )
              trunk_layers.append(
                  Conv(
                      (3, 3, 256),
                      strides=1,
                      padding=0,
                      name="conv{}_2".format(layer_num),
                      **params,
                  )
              )
  
      layers = []
      output_config = OrderedDict()
      mbox_index = 1
  
      for layer in self.ssd_config:
          index = self.find_insertion_index(trunk_layers, layer)
          conv_layer = self.get_conv_layer(trunk_layers, index)
  
          branch_node = BranchNode(name=layer + "_branch")
          trunk_layers.insert(index, branch_node)
  
          leafs = self.generate_leafs(layer)
          is_terminal = layer == "conv{}_2".format(max_layer_num)
  
          # append leafs to layers
          # mbox_loc_index and mbox_conf_index map to locations
          # in the output list of the model.
  
          if self.ssd_config[layer]["normalize"]:
              branch = self.create_normalize_branch(
                  leafs, branch_node, layer
              )
              layers.append(branch)
              mbox_loc_index = (mbox_index, 0)
              mbox_conf_index = (mbox_index, 1)
              mbox_index += 1
  
          else:
              if is_terminal:
                  trunk_layers.append(leafs["mbox_loc"])
                  mbox_loc_index = (0,)
              else:
                  layers.append([branch_node, leafs["mbox_loc"]])
                  mbox_loc_index = (mbox_index,)
                  mbox_index += 1
  
              layers.append([branch_node, leafs["mbox_conf"]])
              mbox_conf_index = (mbox_index,)
              mbox_index += 1
  
          output_config[layer] = {
              "layers": leafs,
              "conv_layer": conv_layer,
              "index": {
                  "mbox_conf": mbox_conf_index,
                  "mbox_loc": mbox_loc_index,
              },
          }
  
      layers.insert(0, trunk_layers)
  
      return layers, output_config
  
imports: from neon.initializers import Constant, Xavier
  from neon.transforms import Rectlin
  from neon.layers import Conv, Pooling, BranchNode
  from layer import Normalize, PriorBox, DetectionOutput, ConcatTranspose
  import numpy
  from neon.util.persist import load_obj
  from neon.layers.container import Tree
  from neon.layers.layer import Layer
  from collections import OrderedDict
  import inspect
  import re
  from neon.data.datasets import Dataset
  import os
label_desc: Use image node_id 8 for calling the SSD obj's underlying member method code with example usage: obj.generate_layers() and returns: layers,  output_config