class_docstr: This decomposition rule handles the positive forward
  activations (x*w > 0) and negative forward activations
  (w * x < 0) independently, reducing the risk of zero
  divisions considerably. In fact, the only case where
  divisions by zero can happen is if there are either
  no positive or no negative parts to the activation
  at all.
  Corresponding parameterization of this rule implement
  methods such as Excitation Backpropagation with
  alpha=1, beta=0
  s.t.
  alpha - beta = 1 (after current param. scheme.)
  and
  alpha > 1
  beta > 0
class_docstr_tok: ["This","decomposition","rule","handles","the","positive","forward","activations","(","x","*","w",">","0",")","and","negative","forward","activations","(","w","*","x","<","0",")","independently",",","reducing","the","risk","of","zero","divisions","considerably",".","In","fact",",","the","only","case","where","divisions","by","zero","can","happen","is","if","there","are","either","no","positive","or","no","negative","parts","to","the","activation","at","all",".","Corresponding","parameterization","of","this","rule","implement","methods","such","as","Excitation","Backpropagation","with","alpha=1",",","beta=0","s.t",".","alpha","-","beta","=","1","(","after","current","param",".","scheme",".",")","and","alpha",">","1","beta",">","0"]
code: def __init__(
      self,
      layer: Layer,
      _state,
      alpha=None,
      beta=None,
      bias: bool = True,
      copy_weights=False,
  ) -> None:
      alpha, beta = rutils.assert_infer_lrp_alpha_beta_param(
          alpha, beta, self
      )
      self._alpha = alpha
      self._beta = beta
  
      # prepare positive and negative weights for computing positive
      # and negative preactivations z in apply_accordingly.
      if copy_weights:
          weights = layer.get_weights()
          if not bias and getattr(layer, "use_bias", False):
              weights = weights[:-1]
          positive_weights = [x * (x > 0) for x in weights]
          negative_weights = [x * (x < 0) for x in weights]
      else:
          weights = layer.weights
          if not bias and getattr(layer, "use_bias", False):
              weights = weights[:-1]
          positive_weights = [
              x * ibackend.cast_to_floatx(x > 0) for x in weights
          ]
          negative_weights = [
              x * ibackend.cast_to_floatx(x < 0) for x in weights
          ]
  
      self._layer_wo_act_positive = igraph.copy_layer_wo_activation(
          layer,
          keep_bias=bias,
          weights=positive_weights,
          name_template="reversed_kernel_positive_%s",
      )
      self._layer_wo_act_negative = igraph.copy_layer_wo_activation(
          layer,
          keep_bias=bias,
          weights=negative_weights,
          name_template="reversed_kernel_negative_%s",
      )
  
imports: from __future__ import annotations
  import numpy
  import tensorflow.keras.backend
  import tensorflow.keras.layers
  import innvestigate.analyzer.relevance_based.utils
  import innvestigate.backend
  import innvestigate.backend.graph
  import innvestigate.layers
  from innvestigate.backend.types import Layer, OptionalList, Tensor
label_desc: Use image node_id 1 to create a new AlphaBetaRule object from inherited base classes: igraph with example: obj = AlphaBetaRule(layer, _state, alpha, beta, bias, copy_weights)