Skip to content

Commit

Permalink
[DOC] Small fixes in graph alignment tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
ulupo committed May 17, 2024
1 parent 1a8ba8c commit 2022080
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions nbs/tutorials/graph_alignment.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
"\n",
"# Create the Laplacian matrix of the first graph\n",
"x = create_test_sbm_laplacian(block_sizes, probs)\n",
"n_nodes = len(x) # In case the number of nodes has changed due to removal of isolates\n",
"\n",
"# Define the second graph by randomly permuting the nodes in the first\n",
"P = torch.zeros_like(x)\n",
Expand All @@ -146,7 +147,9 @@
"from diffpass.train import GraphAlignment, IntraGroupSimilarityLoss\n",
"\n",
"group_sizes = [n_nodes]\n",
"comparison_loss = IntraGroupSimilarityLoss(group_sizes=group_sizes, exclude_diagonal=False) # Default behaviour except for inclusion of the main diagonal\n",
"comparison_loss = IntraGroupSimilarityLoss(\n",
" group_sizes=group_sizes, exclude_diagonal=False\n",
") # Default behaviour except for inclusion of the main diagonal\n",
"\n",
"# Initialize the GraphAlignment model\n",
"graph_alignment = GraphAlignment(\n",
Expand Down Expand Up @@ -203,8 +206,6 @@
"metadata": {},
"outputs": [],
"source": [
"from diffpass.data_utils import compute_num_correct_pairings\n",
"\n",
"def plot_hard_losses(\n",
" results,\n",
" target_hard_loss: Optional[float] = None\n",
Expand Down

0 comments on commit 2022080

Please sign in to comment.