docstr: Function to store TensorFlow weights back to into a dict in CoreML format to be used
  by the C++ implementation
  
  Returns
  -------
  tf_export_params: Dictionary
      Dictionary of weights from TensorFlow stored as {weight_name: weight_value}
docstr_tok: ["Function","to","store","TensorFlow","weights","back","to","into","a","dict","in","CoreML","format","to","be","used","by","the","C++","implementation","Returns","--","--","--","-","tf_export_params",":","Dictionary","Dictionary","of","weights","from","TensorFlow","stored","as","{","weight_name",":","weight_value","}"]
code: def export_weights(self):
      """
      Function to store TensorFlow weights back to into a dict in CoreML format to be used
      by the C++ implementation
  
      Returns
      -------
      tf_export_params: Dictionary
          Dictionary of weights from TensorFlow stored as {weight_name: weight_value}
      """
      tf_export_params = {}
  
      # First dense layer
      l = self.model.layers[1]
      (
          tf_export_params["conv_weight"],
          tf_export_params["conv_bias"],
      ) = l.get_weights()
      tf_export_params[
          "conv_weight"
      ] = _utils.convert_conv1d_tf_to_coreml(
          tf_export_params["conv_weight"]
      )
  
      # LSTM layer
      l = self.model.layers[3]
      i2h, h2h, bias = l.get_weights()
  
      biases = _np.split(bias, 4)
      i2h = _np.swapaxes(i2h, 0, 1)
      i2h = _np.split(i2h, 4)
      h2h = _np.swapaxes(h2h, 0, 1)
      h2h = _np.split(h2h, 4)
  
      for i, c in enumerate(["i", "f", "c", "o"]):
          cur_bias_key = "lstm_h2h_%s_bias" % c
          tf_export_params[cur_bias_key] = biases[i]
  
          cur_i2h_key = "lstm_i2h_%s_weight" % c
          tf_export_params[cur_i2h_key] = i2h[i]
  
          cur_h2h_key = "lstm_h2h_%s_weight" % c
          tf_export_params[cur_h2h_key] = h2h[i]
  
      # Second dense layer
      l = self.model.layers[4]
      dense2_weights, tf_export_params["dense0_bias"] = l.get_weights()
      dense2_weights = dense2_weights.swapaxes(1, 0).reshape(
          DENSE_H, LSTM_H, 1, 1
      )
      tf_export_params["dense0_weight"] = dense2_weights
  
      # Batch Norm weights
      l = self.model.layers[5]
      (
          tf_export_params["bn_gamma"],
          tf_export_params["bn_beta"],
          tf_export_params["bn_running_mean"],
          tf_export_params["bn_running_var"],
      ) = l.get_weights()
  
      # Last dense layer
      l = self.model.layers[8]
      dense3 = l.get_weights()[0]
      dense3 = dense3.swapaxes(1, 0).reshape(
          self.num_classes, DENSE_H, 1, 1
      )
      tf_export_params["dense1_weight"] = dense3
  
      return tf_export_params
  
file_path: turicreate/src/python/turicreate/toolkits/activity_classifier/_tf_model_architecture.py
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import turicreate.toolkits._tf_utils
  from .._tf_model import TensorFlowModel
  import numpy
  from turicreate._deps.minimal_package import _minimal_package_import_check
label_desc: Use image node_id 4 for calling the ActivityTensorFlowModel obj's underlying member method code with example usage: obj.export_weights() and returns: tf_export_params