Logic explanations for \(\psi\) LENs

torch_explain.logic.nn.psi

torch_explain.logic.nn.psi.explain_class(model: Module, x: Optional[tensor] = None, concept_names: Optional[list] = None, device: device = device(type='cpu')) str

Generate the FOL formulas corresponding to the parameters of a psi network.

Parameters:
  • model – pytorch model

  • x – input samples to extract logic formulas.

  • concept_names – list of names of the input features.

  • device – cpu or cuda device.

Returns:

Global explanation