signxai.tf_signxai.methods_impl.innvestigate.tools package
Submodules
signxai.tf_signxai.methods_impl.innvestigate.tools.pattern module
- signxai.tf_signxai.methods_impl.innvestigate.tools.pattern.get_active_neuron_io(layer, active_node_indices, return_i=True, return_o=True, do_activation_search=False)[source]
Returns the neuron-wise input output for the passed layer. This is done while taking care of only considering layer nodes that are listed as active.
Starting from the passed layer this functions returns the first layer with an activation upstream in the model, if do_activation_search is an execution list. Otherwise the current layer’s output is returned.
- class signxai.tf_signxai.methods_impl.innvestigate.tools.pattern.BasePattern(model, layer, model_tensors=None, execution_list=None)[source]
Bases:
objectInterface for pattern objects used to compute patterns by the PatternComputer class.
The basic work-flow is that a pattern computes statistics for the passed layer, which are then used to compute the final pattern.
- class signxai.tf_signxai.methods_impl.innvestigate.tools.pattern.DummyPattern(model, layer, model_tensors=None, execution_list=None)[source]
Bases:
BasePatternComputes a dummy pattern for test purposes.
- class signxai.tf_signxai.methods_impl.innvestigate.tools.pattern.LinearPattern(model, layer, model_tensors=None, execution_list=None)[source]
Bases:
BasePattern
- class signxai.tf_signxai.methods_impl.innvestigate.tools.pattern.ReLUPositivePattern(model, layer, model_tensors=None, execution_list=None)[source]
Bases:
LinearPattern
- class signxai.tf_signxai.methods_impl.innvestigate.tools.pattern.ReLUNegativePattern(model, layer, model_tensors=None, execution_list=None)[source]
Bases:
LinearPattern
- class signxai.tf_signxai.methods_impl.innvestigate.tools.pattern.PatternComputer(model, pattern_type='linear', compute_layers_in_parallel=True, gpus=None)[source]
Bases:
objectPattern computer.
Computes a pattern for each layer with a kernel of a given model.
- Parameters:
model – A Keras model.
pattern_type – A string or a tuple of strings. Valid types are ‘linear’, ‘relu’, ‘relu.positive’, ‘relu.negative’.
compute_layers_in_parallel – Not supported yet. Compute all patterns at once. Otherwise computer layer after layer.
gpus – Not supported yet. Gpus to use.