Transformer lens utils
auto_circuit.model_utils.transformer_lens_utils
Classes
Functions
factorized_dest_nodes
factorized_dest_nodes(model: HookedTransformer, separate_qkv: bool) -> Set[DestNode]
Get the destination part of each edge in the factorized graph, grouped by layer.
Factorization introduced by Elhage et al. (2021). See Molina (2023) for a good explanation.
Source code in auto_circuit/model_utils/transformer_lens_utils.py
factorized_src_nodes
factorized_src_nodes(model: HookedTransformer) -> Set[SrcNode]
Get the source part of each edge in the factorized graph, grouped by layer.
Factorization introduced by Elhage et al. (2021). See also Molina (2023) for a good explanation.
Source code in auto_circuit/model_utils/transformer_lens_utils.py
simple_graph_nodes
Get the nodes of the unfactorized graph.
graph_edges
requires that all input
SrcNodes
are in the previous layer to the respective
DestNodes
.
Source code in auto_circuit/model_utils/transformer_lens_utils.py
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 |
|