code: def mean_normalise_weights_for_sequence_convolution(
      weights, bias, axis_of_normalisation, dim_ordering
  ):
      print(
          "Normalising weights for one-hot encoded sequence convolution"
      )
      print("axis of normalisation is: " + str(axis_of_normalisation))
      print(
          "Weight shape on that axis is: "
          + str(weights.shape[axis_of_normalisation])
      )
      mean_weights_at_positions = np.mean(
          weights, axis=axis_of_normalisation
      )
      if dim_ordering == "th":
          print(
              "Theano dimension ordering; output channel axis is first one "
              "which has a length of " + str(weights.shape[0])
          )
          # sum across remaining dimensions except output channel which is first
          new_bias = bias + np.sum(
              np.sum(mean_weights_at_positions, axis=1), axis=1
          )
      elif dim_ordering == "tf":
          print(
              "Tensorflow dimension ordering; output channel axis is last one "
              "which has a length of " + str(weights.shape[-1])
          )
          # sum across remaining dimensions except output channel which is last
          new_bias = bias + np.sum(
              np.sum(mean_weights_at_positions, axis=0), axis=0
          )
      else:
          raise RuntimeError(
              "Unsupported dim ordering " + str(dim_ordering)
          )
      mean_weights_at_positions = np.expand_dims(
          mean_weights_at_positions, axis_of_normalisation
      )
      renormalised_weights = weights - mean_weights_at_positions
      return renormalised_weights, new_bias
  
imports: from __future__ import division
  from __future__ import print_function
  from __future__ import absolute_import
  import sys
  import os
  import os.path
  import numpy
  from collections import namedtuple
  from collections import OrderedDict
  import json
  import deeplift
  import tensorflow
label_desc: Use image node_id 10 for calling a global function with example usage: mean_normalise_weights_for_sequence_convolution(weights, bias, axis_of_normalisation, dim_ordering) and returns: renormalised_weights,  new_bias