code: def get_model(model, ctx, opt):
      
      kwargs = {'ctx': ctx, 'pretrained': opt.use_pretrained, 'classes': classes}
      if model.startswith('resnet'):
          kwargs['thumbnail'] = opt.use_thumbnail
      elif model.startswith('vgg'):
          kwargs['batch_norm'] = opt.batch_norm
  
      net = models.get_model(model, **kwargs)
      if opt.resume:
          net.load_parameters(opt.resume)
      elif not opt.use_pretrained:
          if model in ['alexnet']:
              net.initialize(mx.init.Normal())
          else:
              net.initialize(mx.init.Xavier(magnitude=2))
      net.cast(opt.dtype)
      return net
docs: Model initialization.