Micro model utils
auto_circuit.model_utils.micro_model_utils
This module defines a tiny toy model used mostly for testing purposes.
Classes
Block
Bases: Module
Trivial linear layer with input and output of size 2.
Source code in auto_circuit/model_utils/micro_model_utils.py
MicroModel
Bases: Module
A trivial model with two "heads" per layer that perform simple multiplication.
Source code in auto_circuit/model_utils/micro_model_utils.py
Functions
factorized_dest_nodes
factorized_dest_nodes(model: MicroModel) -> Set[DestNode]
Get the destination part of each edge in the factorized graph, grouped by layer.
Used by graph_edges
in
patchable_model
.
Source code in auto_circuit/model_utils/micro_model_utils.py
factorized_src_nodes
factorized_src_nodes(model: MicroModel) -> Set[SrcNode]
Get the source part of each edge in the factorized graph, grouped by layer.
Used by graph_edges
in
patchable_model
.
Source code in auto_circuit/model_utils/micro_model_utils.py
simple_graph_nodes
simple_graph_nodes(model: MicroModel) -> Tuple[Set[SrcNode], Set[DestNode]]
Get the nodes of the unfactorized graph.
graph_edges
requires that all input
SrcNodes
are in the previous layer to the respective
DestNodes
.