Repository navigation
WIP: Some tweaks in tutorial notebooks - #336
Conversation
…legating to MultiOrderModel
Co-authored-by: Moritz Lampert <moritz@lampert.ai>
…g. Moved basic tutorials to tutorial/basic.
The tutorials were merged from different development efforts and covered several topics more than once. Each concept is now introduced in one place, with links between notebooks instead of repetition. - Archive notebooks that duplicated others (temporal_graphs_in_pathpyg, loading_networks, trp_event_graphs, causality_aware_gnns) and remove them from the nav; order DBGNN before the TGN baseline - network_matrices now focuses on adjacency and Laplacian matrices only - Time-respecting paths and temporal centralities are introduced once, in trp_centralities_communities - Use Graph.laplacian() instead of hand-rolled Laplacians in the graph learning notebooks - Fix references to non-existent notebooks and stale links - Re-export all affected notebooks Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolve conflicts in tutorial notebooks: vb/hograph updated notebooks at their old locations, which vb/doc_fixes has moved or archived. Its source changes are ported to the marimo sources (implementation_concepts now uses the HigherOrderGraph and EventGraph classes; text fixes in paths_higher_order, trp_higher_order and dbgnn), and all tutorials are re-exported against the merged code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
HigherOrderGraph.__add__ kept edges present in both graphs as parallel edges, although a HigherOrderGraph aggregates repeated observations of the same path into a single weighted edge. Duplicate edges are now merged and their edge weights summed. For order 0, self-loops are identified by the first-order node they emit. Other edge attributes are reduced with the `reduce` argument that is already used for node attributes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- "Working with Higher-Order De Bruijn Graphs" covers creating HigherOrderGraph objects from paths and graphs, node sequences, combining graphs, observed vs. possible paths, the order-0 model, projections to first order, and the bipartite edge index used by DBGNNs - "Event Graphs" covers creating EventGraph objects from temporal graphs, event timestamps and attributes, reduce_delta, shortest time-respecting paths, and aggregation into HigherOrderGraph objects - Link both from the neighbouring tutorials and add them to the nav Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TemporalGraph sorted events with an unstable argsort, so constructing a TemporalGraph from data that is already sorted could permute events with identical timestamps. EventGraph.to_temporal_graph() then no longer matched the event indices of the event graph, which led to wrong results in EventGraph.shortest_paths() and MultiOrderModel/HigherOrderGraph.from_event_graph for temporal graphs with ties in their timestamps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Explain that the layers of a MultiOrderModel are HigherOrderGraph objects - Show HigherOrderGraph.from_temporal_graph for a single order - Reuse an EventGraph for two values of delta via MultiOrderModel.from_event_graph and reduce_delta in the ants example - Re-export all tutorials after the stable sort fix in TemporalGraph Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fix prose that contradicted the library or the code in the same notebook: - paths_higher_order: inspect the second-order layers instead of the first-order one, and name the MultiOrderModel class correctly - trp_higher_order: the order-3 graph has six nodes and four edges - trp_centralities_communities: drop the false column-renaming claim and describe the random-walk simulation as implemented - temporal_graphs: temporal graphs wrap a Data object, not TemporalData - visualisation: correct the default layout and colormap, drop zoom/pan - generative_models: correct the stochastic block matrix definition - netzschleuder: evaluate on a non-empty test set - manim_tutorial: timestamps are binned into 12-hour intervals - torch_sgd: fix the sigmoid, the gradient sign and the logistic regression comparison - neural_networks: the loss is mean squared error - message_passing_pyg: view(-1, 1) reshapes for broadcasting - gcns: the training cell plots the training loss - docker_installation: update to torch 2.8.0 and PyG >= 2.5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@M-Lampert - I've had several extended sessions with Claude and have merged all the documentation (existing as well the ones we got from polnets-tutorials. I've also added 2 new tutorials on Admittedly, after the tweaks for the basic notebooks (now under a "Getting Started" menu item) that I did go through manually, I haven't gone through the advanced tutorials manually at all. All I've honestly done is to ensure that they render without any errors (w.r.t the existing and upcoming changes to the Since this PR adds a whole bunch of infrastructure changes to the doc generation in the CI, namely:
I'm wondering if we should merge this PR first (pending any workflow changes that you suggest, which I'm happy to make) and then check the docs on the "live" site for manual review? This will allow us to separate any bugs in the docs generation process with wording changes needed in the docs themselves. |
|
This looks great! Thank you for sorting all of this out. Just to confirm that I understood the organisation and the workflow correctly: We've switched to Marimo notebooks, which are basically Python files. Editing the notebooks needs to be done in these Marimo notebooks, which work well with version control. We still have Jupyter notebooks for displaying the notebooks on the documentation website. These notebooks need to be re-exported manually from the Marimo notebooks whenever we make any changes to the notebooks or the source code that would change the output of any of the notebooks. To make sure that at least the code in the notebooks is in sync, we have a CI test that checks if the code in the Python files is the same as the one in the Jupyter code cells. Did I get the workflow right? If I understood everything correctly, then everything looks good to me, and I only have one minor suggestion before we can merge this: Can we move the Jupyter files into a separate subdirectory inside each tutorial subdirectory called something like |
|
@M-Lampert - yes, all your observations are correct. Normally we would just do everything in the Marimo world, but since we're using Great point about separating notebooks into a |
|
Thanks! Feel free to merge once that is done. |

Closes #331
I'm going through the tutorial notebooks in sequence carefully to make sure they're not advertising concepts that have been superseded by newer code in
dev, plus any other minor issues I see.Builds on top of any PRs < 336, so those should be reviewed/merged first, and this one rebased on
devfor a cleaner review.This PR will also eventually cover any new sections we want to add to these tutorials (including
EventGraphorHigherOrderGraph.