class_docstr: Interface for tensorflow models.
docstr: Consider the first layer neuron before non-linearity: z = w^T * x1 + b1. We update
  the bias b1 to b2:= b1 - w^T * m (= 2*b1 - (w^T * m + b1)). The operation is necessary
  for Input Invariance metric.
  
  
  Parameters
  ----------
  input_shift: Union[int, float]
      Shift to be applied.
  shape: tuple
      Model input shape, ndim = 4.
  
  Returns
  -------
  random_layer_model: Model
      The resulting model with a shifted first layer.
docstr_tok: ["Consider","the","first","layer","neuron","before","non-linearity",":","z","=","w^T","*","x1","+","b1",".","We","update","the","bias","b1","to","b2",":","=","b1","-","w^T","*","m","(","=","2","*","b1","-","(","w^T","*","m","+","b1",")",")",".","The","operation","is","necessary","for","Input","Invariance","metric",".","Parameters","--","--","--","--","--","input_shift",":","Union","[","int",",","float","]","Shift","to","be","applied",".","shape",":","tuple","Model","input","shape",",","ndim","=","4",".","Returns","--","--","--","-","random_layer_model",":","Model","The","resulting","model","with","a","shifted","first","layer","."]
code: def add_mean_shift_to_first_layer(
      self,
      input_shift: Union[int, float],
      shape: tuple,
  ):
      """
      Consider the first layer neuron before non-linearity: z = w^T * x1 + b1. We update
      the bias b1 to b2:= b1 - w^T * m (= 2*b1 - (w^T * m + b1)). The operation is necessary
      for Input Invariance metric.
  
  
      Parameters
      ----------
      input_shift: Union[int, float]
          Shift to be applied.
      shape: tuple
          Model input shape, ndim = 4.
  
      Returns
      -------
      random_layer_model: Model
          The resulting model with a shifted first layer.
      """
      original_parameters = self.state_dict()
      new_model = clone_model(self.model)
      new_model.set_weights(original_parameters)
  
      module = new_model.layers[0]
      tmp_model = Model(
          inputs=[new_model.input], outputs=[new_model.layers[0].output]
      )
  
      delta = np.zeros(shape=shape)
      delta.fill(input_shift)
      fw = tmp_model(delta)[0]
  
      weights = module.get_weights()
      bias = weights[1]
  
      for i in range(len(bias)):
          if self.channel_first:
              weights[1][i] = 2 * bias[i] - np.unique(fw[i])[0]
          else:
              weights[1][i] = 2 * bias[i] - np.unique(fw[..., i])[0]
  
      module.set_weights(weights)
      return new_model
  
imports: from __future__ import annotations
  from typing import Dict, Optional, Tuple, List, Union, Generator
  from keras.layers import Dense
  from keras import activations
  from keras import Model
  from keras.models import clone_model
  import numpy
  import tensorflow
  from warnings import warn
  from cachetools import cachedmethod, LRUCache
  import operator
  from quantus.helpers.model.model_interface import ModelInterface
  from quantus.helpers import utils
label_desc: Use image node_id 14 for calling the TensorFlowModel obj's underlying member method code with example usage: obj.add_mean_shift_to_first_layer(input_shift, shape) and returns: new_model