Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better explanations re section names in run_rib_build and collect_interaction_edges #192

Closed
stefan-apollo opened this issue Nov 13, 2023 · 2 comments · Fixed by #260
Closed
Assignees
Labels
documentation Improvements or additions to documentation priority-low

Comments

@stefan-apollo
Copy link
Collaborator

I am confused about this in run_rib_build.py

Don't build the graph for the section of the model before the first node layer

And this in collect_interaction_edges

Note that there is no edge weight that uses the position of the final interaction matrix as a starting node. This means that, unless node_layers contained the model output, we ignore the final section name in section_names when calculating the edges.

Just logging confusions to clear up later
@stefan-apollo stefan-apollo added documentation Improvements or additions to documentation priority-low labels Nov 13, 2023
@stefan-apollo
Copy link
Collaborator Author

Explanation I got from Dan, example cases to help understand why these two lines of code:

section_names = [f"sections.{sec}" for sec in seq_model.sections if sec != "pre"]
edge_modules = section_names if Cs[-1].node_layer_name == "output" else section_names[:-1]
  1. node_layers = [mlp_out.3, output] --> expect graph spanning the part between mlp_out.3 and output --> model has sections pre{...}, sec0{...} --> we care about the sec0 module as the relevant function --> section_names = [sec0] --> edge_modules = [sec0]
  2. node_layers = [mlp_out.3, mlp_out.5] --> expect graph spanning the part between mlp_out.3 and mlp_out.5 --> model has sections pre{...}, sec0{mlp_out.3...}, sec1{mlp_out.5...} --> we care about the sec1 module as the relevant function --> section_names = [sec0, sec1] --> edge_modules = [sec1]

@danbraunai-apollo danbraunai-apollo changed the title Better explanations re section names in run_rib_build and collect_interaction_edges (feature/unify) Better explanations re section names in run_rib_build and collect_interaction_edges Dec 15, 2023
@danbraunai-apollo danbraunai-apollo self-assigned this Dec 20, 2023
@danbraunai-apollo
Copy link
Contributor

I haven't really improved this documentation much. though I did add a single example in the rib_builder.py docstring (4de65d0). Hoping this is sufficient.

@danbraunai-apollo danbraunai-apollo changed the title (feature/unify) Better explanations re section names in run_rib_build and collect_interaction_edges Better explanations re section names in run_rib_build and collect_interaction_edges Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation priority-low
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants