Skip to content

Commit

Permalink
re-run notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
loreloc committed Nov 16, 2024
1 parent 2e72e53 commit 1be30b2
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 91 deletions.
30 changes: 11 additions & 19 deletions notebooks/compilation-options.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: user 4.56 s, sys: 1.09 s, total: 5.66 s\n",
"Wall time: 5.56 s\n"
"CPU times: user 4.59 s, sys: 1.01 s, total: 5.6 s\n",
"Wall time: 5.54 s\n"
]
}
],
Expand Down Expand Up @@ -273,7 +273,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"1.17 s ± 14.2 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n"
"1.16 s ± 13.4 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n"
]
}
],
Expand Down Expand Up @@ -338,8 +338,8 @@
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: user 4.65 s, sys: 967 ms, total: 5.62 s\n",
"Wall time: 5.52 s\n"
"CPU times: user 4.72 s, sys: 829 ms, total: 5.55 s\n",
"Wall time: 5.48 s\n"
]
}
],
Expand Down Expand Up @@ -433,7 +433,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"58.9 ms ± 6.43 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)\n"
"59 ms ± 41 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)\n"
]
}
],
Expand Down Expand Up @@ -473,7 +473,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"['TorchCategoricalLayer', 'TorchKroneckerLayer', 'TorchDenseLayer', 'TorchKroneckerLayer', 'TorchDenseLayer', 'TorchMixingLayer', 'TorchKroneckerLayer', 'TorchDenseLayer', 'TorchKroneckerLayer', 'TorchDenseLayer', 'TorchMixingLayer', 'TorchKroneckerLayer', 'TorchDenseLayer', 'TorchKroneckerLayer', 'TorchDenseLayer', 'TorchMixingLayer', 'TorchKroneckerLayer', 'TorchDenseLayer', 'TorchKroneckerLayer', 'TorchDenseLayer', 'TorchMixingLayer', 'TorchKroneckerLayer', 'TorchDenseLayer', 'TorchKroneckerLayer', 'TorchDenseLayer', 'TorchMixingLayer']\n"
"['TorchCategoricalLayer', 'TorchKroneckerLayer', 'TorchSumLayer', 'TorchKroneckerLayer', 'TorchSumLayer', 'TorchSumLayer', 'TorchKroneckerLayer', 'TorchSumLayer', 'TorchKroneckerLayer', 'TorchSumLayer', 'TorchSumLayer', 'TorchKroneckerLayer', 'TorchSumLayer', 'TorchKroneckerLayer', 'TorchSumLayer', 'TorchSumLayer', 'TorchKroneckerLayer', 'TorchSumLayer', 'TorchKroneckerLayer', 'TorchSumLayer', 'TorchSumLayer', 'TorchKroneckerLayer', 'TorchSumLayer', 'TorchKroneckerLayer', 'TorchSumLayer', 'TorchSumLayer']\n"
]
}
],
Expand Down Expand Up @@ -527,8 +527,8 @@
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: user 5.02 s, sys: 929 ms, total: 5.95 s\n",
"Wall time: 5.85 s\n"
"CPU times: user 4.89 s, sys: 972 ms, total: 5.86 s\n",
"Wall time: 5.8 s\n"
]
}
],
Expand Down Expand Up @@ -565,7 +565,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"['TorchCategoricalLayer', 'TorchTuckerLayer', 'TorchTuckerLayer', 'TorchMixingLayer', 'TorchTuckerLayer', 'TorchTuckerLayer', 'TorchMixingLayer', 'TorchTuckerLayer', 'TorchTuckerLayer', 'TorchMixingLayer', 'TorchTuckerLayer', 'TorchTuckerLayer', 'TorchMixingLayer', 'TorchTuckerLayer', 'TorchTuckerLayer', 'TorchMixingLayer']\n"
"['TorchCategoricalLayer', 'TorchTuckerLayer', 'TorchTuckerLayer', 'TorchSumLayer', 'TorchTuckerLayer', 'TorchTuckerLayer', 'TorchSumLayer', 'TorchTuckerLayer', 'TorchTuckerLayer', 'TorchSumLayer', 'TorchTuckerLayer', 'TorchTuckerLayer', 'TorchSumLayer', 'TorchTuckerLayer', 'TorchTuckerLayer', 'TorchSumLayer']\n"
]
}
],
Expand All @@ -591,7 +591,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"25.6 ms ± 26.2 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)\n"
"25.7 ms ± 33.4 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)\n"
]
}
],
Expand All @@ -610,14 +610,6 @@
"source": [
"Note that, we achieved an (approximately) **2.3x speed-up**, when compared to the folded circuit compiled above, and an (approximately) **45.7x speed-up**, when compared to the circuit compiled with no folding and no optimizations."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "ae5edd97-7c99-4f7f-a581-402ddf80763c",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
24 changes: 12 additions & 12 deletions notebooks/learning-a-circuit-with-pic.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -327,17 +327,17 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Step 200: Average NLL: 790.882\n",
"Step 400: Average NLL: 691.674\n",
"Step 600: Average NLL: 674.937\n",
"Step 800: Average NLL: 663.859\n",
"Step 1000: Average NLL: 658.742\n",
"Step 1200: Average NLL: 655.811\n",
"Step 1400: Average NLL: 654.907\n",
"Step 1600: Average NLL: 651.585\n",
"Step 1800: Average NLL: 649.255\n",
"Step 2000: Average NLL: 648.620\n",
"Step 2200: Average NLL: 648.407\n"
"Step 200: Average NLL: 798.951\n",
"Step 400: Average NLL: 704.324\n",
"Step 600: Average NLL: 681.021\n",
"Step 800: Average NLL: 669.410\n",
"Step 1000: Average NLL: 660.258\n",
"Step 1200: Average NLL: 655.782\n",
"Step 1400: Average NLL: 653.661\n",
"Step 1600: Average NLL: 651.993\n",
"Step 1800: Average NLL: 651.169\n",
"Step 2000: Average NLL: 649.297\n",
"Step 2200: Average NLL: 648.773\n"
]
}
],
Expand Down Expand Up @@ -393,7 +393,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Average test LL: -644.205\n",
"Average test LL: -643.881\n",
"Bits per dimension: 1.185\n"
]
}
Expand Down
32 changes: 16 additions & 16 deletions notebooks/learning-a-circuit.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: user 3.56 s, sys: 354 ms, total: 3.92 s\n",
"Wall time: 3.84 s\n"
"CPU times: user 2.71 s, sys: 232 ms, total: 2.94 s\n",
"Wall time: 2.89 s\n"
]
}
],
Expand Down Expand Up @@ -296,17 +296,17 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Step 200: Average NLL: 2487.392\n",
"Step 400: Average NLL: 896.841\n",
"Step 600: Average NLL: 789.079\n",
"Step 800: Average NLL: 753.034\n",
"Step 1000: Average NLL: 732.943\n",
"Step 1200: Average NLL: 719.378\n",
"Step 1400: Average NLL: 708.521\n",
"Step 1600: Average NLL: 699.989\n",
"Step 1800: Average NLL: 694.764\n",
"Step 2000: Average NLL: 688.025\n",
"Step 2200: Average NLL: 684.805\n"
"Step 200: Average NLL: 2492.162\n",
"Step 400: Average NLL: 895.920\n",
"Step 600: Average NLL: 785.733\n",
"Step 800: Average NLL: 750.038\n",
"Step 1000: Average NLL: 729.883\n",
"Step 1200: Average NLL: 716.579\n",
"Step 1400: Average NLL: 707.071\n",
"Step 1600: Average NLL: 698.283\n",
"Step 1800: Average NLL: 693.106\n",
"Step 2000: Average NLL: 686.453\n",
"Step 2200: Average NLL: 683.869\n"
]
}
],
Expand Down Expand Up @@ -367,8 +367,8 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Average test LL: -683.303\n",
"Bits per dimension: 1.257\n"
"Average test LL: -682.416\n",
"Bits per dimension: 1.256\n"
]
}
],
Expand Down Expand Up @@ -464,7 +464,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Average test marginal LL: -378.455\n"
"Average test marginal LL: -377.966\n"
]
}
],
Expand Down
86 changes: 43 additions & 43 deletions notebooks/region-graphs-and-parametrisation.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion notebooks/sum-of-squares-circuits.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@
"torch.cuda.manual_seed(42)\n",
"\n",
"# Set the torch device to use\n",
"device = torch.device('cuda:1')\n",
"device = torch.device('cuda')\n",
"\n",
"# Load the MNIST data set and data loaders\n",
"transform = transforms.Compose([\n",
Expand Down

0 comments on commit 1be30b2

Please sign in to comment.