code: def init_drawing_classifier_graph(self, net_params):
      _tf = _lazy_import_tensorflow()
  
      self.input = _tf.placeholder(
          _tf.float32, [self.batch_size, 28, 28, 1]
      )
      self.weights = _tf.placeholder(_tf.float32, [self.batch_size, 1])
      self.labels = _tf.placeholder(_tf.int64, [self.batch_size, 1])
  
      # One hot encoding target
      reshaped_labels = _tf.reshape(self.labels, [self.batch_size])
      one_hot_labels = _tf.one_hot(
          reshaped_labels, depth=self.num_classes, axis=-1
      )
  
      # Reshaping weights
      reshaped_weights = _tf.reshape(self.weights, [self.batch_size])
  
      self.one_hot_labels = _tf.placeholder(
          _tf.int32, [None, self.num_classes]
      )
  
      # Weights
      weights = {
          name: _tf.Variable(
              _utils.convert_conv2d_coreml_to_tf(net_params[name]),
              name=name,
          )
          for name in (
              "drawing_conv0_weight",
              "drawing_conv1_weight",
              "drawing_conv2_weight",
          )
      }
      weights["drawing_dense1_weight"] = _tf.Variable(
          _utils.convert_dense_coreml_to_tf(
              net_params["drawing_dense1_weight"]
          ),
          name="drawing_dense1_weight",
      )
      """
          To make output of CoreML pool3 (NCHW) compatible with TF (NHWC).
          Decompose FC weights to NCHW. Transpose to NHWC. Reshape back to FC.
          """
      coreml_128_576 = net_params["drawing_dense0_weight"]
      coreml_128_576 = _np.reshape(coreml_128_576, (128, 64, 3, 3))
      coreml_128_576 = _np.transpose(coreml_128_576, (0, 2, 3, 1))
      coreml_128_576 = _np.reshape(coreml_128_576, (128, 576))
      weights["drawing_dense0_weight"] = _tf.Variable(
          _np.transpose(coreml_128_576, (1, 0)),
          name="drawing_dense0_weight",
      )
  
      # Biases
      biases = {
          name: _tf.Variable(net_params[name], name=name)
          for name in (
              "drawing_conv0_bias",
              "drawing_conv1_bias",
              "drawing_conv2_bias",
              "drawing_dense0_bias",
              "drawing_dense1_bias",
          )
      }
  
      conv_1 = _tf.nn.conv2d(
          self.input,
          weights["drawing_conv0_weight"],
          strides=1,
          padding="SAME",
      )
      conv_1 = _tf.nn.bias_add(conv_1, biases["drawing_conv0_bias"])
      relu_1 = _tf.nn.relu(conv_1)
      pool_1 = _tf.nn.max_pool2d(
          relu_1,
          ksize=[1, 2, 2, 1],
          strides=[1, 2, 2, 1],
          padding="VALID",
      )
  
      conv_2 = _tf.nn.conv2d(
          pool_1,
          weights["drawing_conv1_weight"],
          strides=1,
          padding="SAME",
      )
      conv_2 = _tf.nn.bias_add(conv_2, biases["drawing_conv1_bias"])
      relu_2 = _tf.nn.relu(conv_2)
      pool_2 = _tf.nn.max_pool2d(
          relu_2,
          ksize=[1, 2, 2, 1],
          strides=[1, 2, 2, 1],
          padding="VALID",
      )
  
      conv_3 = _tf.nn.conv2d(
          pool_2,
          weights["drawing_conv2_weight"],
          strides=1,
          padding="SAME",
      )
      conv_3 = _tf.nn.bias_add(conv_3, biases["drawing_conv2_bias"])
      relu_3 = _tf.nn.relu(conv_3)
      pool_3 = _tf.nn.max_pool2d(
          relu_3,
          ksize=[1, 2, 2, 1],
          strides=[1, 2, 2, 1],
          padding="VALID",
      )
  
      # Flatten the data to a 1-D vector for the fully connected layer
      fc1 = _tf.reshape(pool_3, (-1, 576))
      fc1 = _tf.nn.xw_plus_b(
          fc1,
          weights=weights["drawing_dense0_weight"],
          biases=biases["drawing_dense0_bias"],
      )
      fc1 = _tf.nn.relu(fc1)
  
      out = _tf.nn.xw_plus_b(
          fc1,
          weights=weights["drawing_dense1_weight"],
          biases=biases["drawing_dense1_bias"],
      )
      self.predictions = _tf.nn.softmax(out)
  
      # Loss
      self.cost = _tf.losses.softmax_cross_entropy(
          logits=out,
          onehot_labels=one_hot_labels,
          weights=reshaped_weights,
          reduction=_tf.losses.Reduction.NONE,
      )
  
      # Optimizer
      self.optimizer = _tf.train.AdamOptimizer(
          learning_rate=0.001
      ).minimize(self.cost)
  
      self.sess = _tf.Session()
      self.sess.run(_tf.global_variables_initializer())
  
file_path: turicreate/src/python/turicreate/toolkits/drawing_classifier/_tf_drawing_classifier.py
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import numpy
  from .._tf_model import TensorFlowModel
  import turicreate.toolkits._tf_utils
  from turicreate._deps.minimal_package import _minimal_package_import_check
label_desc: Use image node_id 2 for calling the DrawingClassifierTensorFlowModel obj's underlying member method code with example usage: obj.init_drawing_classifier_graph(net_params) without return types