torch_concepts.nn.functional.linear_equation_expl

linear_equation_expl(concept_weights: Tensor, bias: Tensor | None = None, concept_names: Dict[int, List[str]] | None = None) List[Dict[str, Dict[str, str]]][source]

Extract linear equations from decoded equations embeddings as strings. :param concept_weights: Equation embeddings with shape (batch_size,

memory_size, n_concepts, n_tasks).

Parameters:
  • bias – Bias term to add to the linear models (batch_size, memory_size, n_tasks).

  • concept_names – Concept and task names. If the bias is included, the concept names should include the bias name.

Returns:

List of predicted equations as strings.

Return type:

List[Dict[str, Dict[str, str]]]