code: def channel_interpolate(layer1, n_channel1, layer2, n_channel2):
      """Interpolate between layer1, n_channel1 and layer2, n_channel2.
  
      Optimize for a convex combination of layer1, n_channel1 and
      layer2, n_channel2, transitioning across the batch.
  
      Args:
        layer1: layer to optimize 100% at batch=0.
        n_channel1: neuron index to optimize 100% at batch=0.
        layer2: layer to optimize 100% at batch=N.
        n_channel2: neuron index to optimize 100% at batch=N.
  
      Returns:
        Objective
      """
  
      def inner(T):
          batch_n = T(layer1).get_shape().as_list()[0]
          arr1 = T(layer1)[..., n_channel1]
          arr2 = T(layer2)[..., n_channel2]
          weights = np.arange(batch_n) / float(batch_n - 1)
          S = 0
          for n in range(batch_n):
              S += (1 - weights[n]) * tf.reduce_mean(arr1[n])
              S += weights[n] * tf.reduce_mean(arr2[n])
          return S
  
      return inner
  
imports: from __future__ import absolute_import, division, print_function
  from decorator import decorator
  import numpy
  import tensorflow
  from lucid.optvis.objectives_util import _dot, _dot_cossim, _extract_act_pos, _make_arg_str, _T_force_NHWC, _T_handle_batch
label_desc: Use image node_id 15 for calling a global function with example usage: channel_interpolate(layer1, n_channel1, layer2, n_channel2) and returns: inner, S