code: def inception_v1(class_num, has_dropout=True):
      feature1 = Sequential()
      feature1.add(
          SpatialConvolution(3, 64, 7, 7, 2, 2, 3, 3, 1, False)
          .set_init_method(
              weight_init_method=Xavier(),
              bias_init_method=ConstInitMethod(0.1),
          )
          .set_name("conv1/7x7_s2")
      )
      feature1.add(ReLU(True).set_name("conv1/relu_7x7"))
      feature1.add(
          SpatialMaxPooling(3, 3, 2, 2, to_ceil=True).set_name(
              "pool1/3x3_s2"
          )
      )
      feature1.add(
          SpatialCrossMapLRN(5, 0.0001, 0.75).set_name("pool1/norm1")
      )
      feature1.add(
          SpatialConvolution(64, 64, 1, 1, 1, 1)
          .set_init_method(
              weight_init_method=Xavier(),
              bias_init_method=ConstInitMethod(0.1),
          )
          .set_name("conv2/3x3_reduce")
      )
      feature1.add(ReLU(True).set_name("conv2/relu_3x3_reduce"))
      feature1.add(
          SpatialConvolution(64, 192, 3, 3, 1, 1, 1, 1)
          .set_init_method(
              weight_init_method=Xavier(),
              bias_init_method=ConstInitMethod(0.1),
          )
          .set_name("conv2/3x3")
      )
      feature1.add(ReLU(True).set_name("conv2/relu_3x3"))
      feature1.add(
          SpatialCrossMapLRN(5, 0.0001, 0.75).set_name("conv2/norm2")
      )
      feature1.add(
          SpatialMaxPooling(3, 3, 2, 2, to_ceil=True).set_name(
              "pool2/3x3_s2"
          )
      )
      feature1.add(
          inception_layer_v1(
              192,
              t([t([64]), t([96, 128]), t([16, 32]), t([32])]),
              "inception_3a/",
          )
      )
  
      feature1.add(
          inception_layer_v1(
              256,
              t([t([128]), t([128, 192]), t([32, 96]), t([64])]),
              "inception_3b/",
          )
      )
  
      feature1.add(
          SpatialMaxPooling(3, 3, 2, 2, to_ceil=True).set_name(
              "pool3/3x3_s2"
          )
      )
  
      feature1.add(
          inception_layer_v1(
              480,
              t([t([192]), t([96, 208]), t([16, 48]), t([64])]),
              "inception_4a/",
          )
      )
  
      output1 = Sequential()
      output1.add(
          SpatialAveragePooling(5, 5, 3, 3, ceil_mode=True).set_name(
              "loss1/ave_pool"
          )
      )
      output1.add(
          SpatialConvolution(512, 128, 1, 1, 1, 1).set_name(
              "loss1/conv"
          )
      )
      output1.add(ReLU(True).set_name("loss1/relu_conv"))
      output1.add(View([128 * 4 * 4, 3]))
      output1.add(Linear(128 * 4 * 4, 1024).set_name("loss1/fc"))
      output1.add(ReLU(True).set_name("loss1/relu_fc"))
      if has_dropout:
          output1.add(Dropout(0.7).set_name("loss1/drop_fc"))
      output1.add(Linear(1024, class_num).set_name("loss1/classifier"))
      output1.add(LogSoftMax().set_name("loss1/loss"))
  
      feature2 = Sequential()
      feature2.add(
          inception_layer_v1(
              512,
              t([t([160]), t([112, 224]), t([24, 64]), t([64])]),
              "inception_4b/",
          )
      )
      feature2.add(
          inception_layer_v1(
              512,
              t([t([128]), t([128, 256]), t([24, 64]), t([64])]),
              "inception_4c/",
          )
      )
      feature2.add(
          inception_layer_v1(
              512,
              t([t([112]), t([144, 288]), t([32, 64]), t([64])]),
              "inception_4d/",
          )
      )
  
      output2 = Sequential()
      output2.add(
          SpatialAveragePooling(5, 5, 3, 3).set_name("loss2/ave_pool")
      )
      output2.add(
          SpatialConvolution(528, 128, 1, 1, 1, 1).set_name(
              "loss2/conv"
          )
      )
      output2.add(ReLU(True).set_name("loss2/relu_conv"))
      output2.add(View([128 * 4 * 4, 3]))
      output2.add(Linear(128 * 4 * 4, 1024).set_name("loss2/fc"))
      output2.add(ReLU(True).set_name("loss2/relu_fc"))
      if has_dropout:
          output2.add(Dropout(0.7).set_name("loss2/drop_fc"))
      output2.add(Linear(1024, class_num).set_name("loss2/classifier"))
      output2.add(LogSoftMax().set_name("loss2/loss"))
  
      output3 = Sequential()
      output3.add(
          inception_layer_v1(
              528,
              t([t([256]), t([160, 320]), t([32, 128]), t([128])]),
              "inception_4e/",
          )
      )
      output3.add(
          SpatialMaxPooling(3, 3, 2, 2, to_ceil=True).set_name(
              "pool4/3x3_s2"
          )
      )
      output3.add(
          inception_layer_v1(
              832,
              t([t([256]), t([160, 320]), t([32, 128]), t([128])]),
              "inception_5a/",
          )
      )
      output3.add(
          inception_layer_v1(
              832,
              t([t([384]), t([192, 384]), t([48, 128]), t([128])]),
              "inception_5b/",
          )
      )
      output3.add(
          SpatialAveragePooling(7, 7, 1, 1).set_name("pool5/7x7_s1")
      )
      if has_dropout:
          output3.add(Dropout(0.4).set_name("pool5/drop_7x7_s1"))
      output3.add(View([1024, 3]))
      output3.add(
          Linear(1024, class_num)
          .set_init_method(
              weight_init_method=Xavier(), bias_init_method=Zeros()
          )
          .set_name("loss3/classifier")
      )
      output3.add(LogSoftMax().set_name("loss3/loss3"))
  
      split2 = Concat(2).set_name("split2")
      split2.add(output3)
      split2.add(output2)
  
      mainBranch = Sequential()
      mainBranch.add(feature2)
      mainBranch.add(split2)
  
      split1 = Concat(2).set_name("split1")
      split1.add(mainBranch)
      split1.add(output1)
  
      model = Sequential()
  
      model.add(feature1)
      model.add(split1)
  
      model.reset()
      return model
  
file_path: BigDL/python/dllib/src/bigdl/dllib/models/inception/inception.py
imports: from bigdl.dllib.nn.layer import *
  from optparse import OptionParser
  from bigdl.dllib.nn.criterion import *
  from bigdl.dllib.nn.initialization_method import *
  from bigdl.dllib.optim.optimizer import *
  from bigdl.dllib.feature.transform.vision.image import *
  from bigdl.dllib.nncontext import *
  from bigdl.dllib.utils.utils import detect_conda_env_name
  import os
  from math import ceil
  from bigdl.dllib.utils.log4Error import *
label_desc: Use image node_id 4 for calling a global function with example usage: inception_v1(class_num, has_dropout) and returns: model