Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Notebook cleanup: strip outputs / execution counts before commit.
# Install once: pip install pre-commit && pre-commit install
repos:
- repo: https://github.com/kynan/nbstripout
rev: 0.8.2
hooks:
- id: nbstripout
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,24 @@ encoder and MRD (see `.coveragerc`). MPI parallel inference and prediction-only
SVI helpers remain omitted until those paths are removed or revived
(CIP-0001 Phases 2–4).

Pre-commit (notebooks)
----------------------

Commits strip Jupyter outputs and execution counts via
[nbstripout](https://github.com/kynan/nbstripout) so notebook diffs stay
readable. Install once after cloning::

```bash
python -m pip install pre-commit
pre-commit install
```

Hooks run automatically on ``git commit``. To strip existing notebooks::

```bash
pre-commit run nbstripout --all-files
```

Multi-view / MRD (CIP-0002)
---------------------------

Expand Down
38 changes: 26 additions & 12 deletions examples/damianou2013/notebooks/01_toy_hierarchy.ipynb
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
{
"nbformat": 4,
"nbformat_minor": 5,
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
}
},
"cells": [
{
"cell_type": "markdown",
"id": "0",
"metadata": {},
"source": [
"# Toy hierarchy \u2014 \u00a74.1 / fig. 2\n",
"# Toy hierarchy — §4.1 / fig. 2\n",
"\n",
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/SheffieldML/PyDeepGP/blob/main/examples/damianou2013/notebooks/01_toy_hierarchy.ipynb)\n",
"\n",
Expand All @@ -26,6 +18,7 @@
},
{
"cell_type": "markdown",
"id": "1",
"metadata": {},
"source": [
"## Setup\n"
Expand All @@ -34,6 +27,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "2",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -76,6 +70,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "3",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -92,6 +87,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "4",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -104,6 +100,7 @@
},
{
"cell_type": "markdown",
"id": "5",
"metadata": {},
"source": [
"## Load Matlab ground-truth hierarchy\n"
Expand All @@ -112,6 +109,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "6",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -134,14 +132,16 @@
},
{
"cell_type": "markdown",
"id": "7",
"metadata": {},
"source": [
"## Fit two-view DeepGP (Q shared \u2192 top)\n"
"## Fit two-view DeepGP (Q shared → top)\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "8",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -163,6 +163,7 @@
},
{
"cell_type": "markdown",
"id": "9",
"metadata": {},
"source": [
"## Recovered latents (dominant ARD dims)\n"
Expand All @@ -171,6 +172,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "10",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -192,6 +194,7 @@
},
{
"cell_type": "markdown",
"id": "11",
"metadata": {},
"source": [
"## Baselines: stacked PCA and Isomap\n"
Expand All @@ -200,6 +203,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "12",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -226,6 +230,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "13",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -250,5 +255,14 @@
"plt.show()\n"
]
}
]
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
40 changes: 26 additions & 14 deletions examples/damianou2013/notebooks/02_toy_warped_regression.ipynb
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
{
"nbformat": 4,
"nbformat_minor": 5,
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
}
},
"cells": [
{
"cell_type": "markdown",
"id": "0",
"metadata": {},
"source": [
"# Warped regression \u2014 \u00a74.1 / fig. 3\n",
"# Warped regression — §4.1 / fig. 3\n",
"\n",
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/SheffieldML/PyDeepGP/blob/main/examples/damianou2013/notebooks/02_toy_warped_regression.ipynb)\n",
"\n",
Expand All @@ -26,6 +18,7 @@
},
{
"cell_type": "markdown",
"id": "1",
"metadata": {},
"source": [
"## Setup\n"
Expand All @@ -34,6 +27,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "2",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -76,6 +70,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "3",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -91,11 +86,12 @@
{
"cell_type": "code",
"execution_count": null,
"id": "4",
"metadata": {},
"outputs": [],
"source": [
"QUICK = True\n",
"PAPER = False # True \u2192 N=120, D=10\n",
"PAPER = False # True → N=120, D=10\n",
"n_toy, d_toy = (120, 10) if PAPER else (150, 15)\n",
"n_tr = 25\n",
"q = 3 if QUICK else 6\n",
Expand All @@ -109,6 +105,7 @@
},
{
"cell_type": "markdown",
"id": "5",
"metadata": {},
"source": [
"## Generative process (`hierGpsNEW`)\n"
Expand All @@ -117,6 +114,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "6",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -135,6 +133,7 @@
},
{
"cell_type": "markdown",
"id": "7",
"metadata": {},
"source": [
"## Fit sparse GP and DeepGP across repeats\n"
Expand All @@ -143,6 +142,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "8",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -171,6 +171,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "9",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -188,13 +189,14 @@
" print(f\"Repeat {r + 1}/{repeats}: MSE GP={gp_mses[-1]:.4f} DeepGP={dgp_mses[-1]:.4f}\")\n",
"\n",
"print(\n",
" f\"Mean MSE (\u00b1std): GP {np.mean(gp_mses):.4f}\u00b1{np.std(gp_mses):.4f} \"\n",
" f\"DeepGP {np.mean(dgp_mses):.4f}\u00b1{np.std(dgp_mses):.4f}\"\n",
" f\"Mean MSE (±std): GP {np.mean(gp_mses):.4f}±{np.std(gp_mses):.4f} \"\n",
" f\"DeepGP {np.mean(dgp_mses):.4f}±{np.std(dgp_mses):.4f}\"\n",
")\n"
]
},
{
"cell_type": "markdown",
"id": "10",
"metadata": {},
"source": [
"## Fig. 3(b)-style MSE plot\n"
Expand All @@ -203,6 +205,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "11",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -218,5 +221,14 @@
"plt.show()\n"
]
}
]
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Loading
Loading