Skip to content

uploaded first notebooks from notebook competition#59

Merged
koaning merged 1 commit into
mainfrom
koaning/jam-2026-q2-links
May 1, 2026
Merged

uploaded first notebooks from notebook competition#59
koaning merged 1 commit into
mainfrom
koaning/jam-2026-q2-links

Conversation

@koaning

@koaning koaning commented May 1, 2026

Copy link
Copy Markdown
Collaborator

There's probably more, but these stood out and these are stand-alone.

Copilot AI review requested due to automatic review settings May 1, 2026 08:43
@koaning koaning merged commit 481675c into main May 1, 2026
4 checks passed
@koaning koaning deleted the koaning/jam-2026-q2-links branch May 1, 2026 08:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds new JAM 2026 Q2 competition notebooks to the gallery and links them from the top-level README.

Changes:

  • Add inscribed-squares.py marimo notebook (diffusion → inscribed squares walkthrough) with remote .npz gallery loading.
  • Add geometry-of-noise.py marimo notebook (closed-form diffusion geometry demo with Pyodide widgets).
  • Update README.md to include new MoLab links for the added notebooks (and dead-salmon.py).

Reviewed changes

Copilot reviewed 3 out of 7 changed files in this pull request and generated 5 comments.

File Description
notebooks/jam-2026-Q2/inscribed-squares.py New notebook demonstrating inscribed-square diffusion results, including gallery loading + interactive visuals.
notebooks/jam-2026-Q2/geometry-of-noise.py New notebook implementing interactive Pyodide widgets to explain diffusion “blindness” analytically.
README.md Adds entries linking to the new notebooks in MoLab.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +84 to +107
from pathlib import Path as _Path

# Prefer the PNG on disk; fall back to the base64-encoded text file if
# the image asset isn't shipped alongside the notebook (e.g., in molab).
_src = None
try:
_dir = _Path(__file__).parent / "figures"
_png = _dir / "cifar10_comparison.png"
_txt = _dir / "cifar10_comparison_b64.txt"
if _png.exists():
_src = _png
elif _txt.exists():
_src = f"data:image/png;base64,{_txt.read_text().strip()}"
except (NameError, OSError):
_src = None

if _src is not None:
_figure = mo.image(src=_src, width="100%", rounded=True)
else:
_figure = mo.md("*(CIFAR-10 figure not found)*")

mo.vstack([
_figure,
mo.md(

Copilot AI May 1, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section attempts to load notebooks/jam-2026-Q2/figures/cifar10_comparison.png (or the _b64.txt fallback), but there is no figures/ directory committed alongside this notebook. As a result, the notebook will always render "(CIFAR-10 figure not found)". Either commit the referenced figure asset(s) under notebooks/jam-2026-Q2/figures/ or remove/update this cell so it doesn't reference missing files.

Suggested change
from pathlib import Path as _Path
# Prefer the PNG on disk; fall back to the base64-encoded text file if
# the image asset isn't shipped alongside the notebook (e.g., in molab).
_src = None
try:
_dir = _Path(__file__).parent / "figures"
_png = _dir / "cifar10_comparison.png"
_txt = _dir / "cifar10_comparison_b64.txt"
if _png.exists():
_src = _png
elif _txt.exists():
_src = f"data:image/png;base64,{_txt.read_text().strip()}"
except (NameError, OSError):
_src = None
if _src is not None:
_figure = mo.image(src=_src, width="100%", rounded=True)
else:
_figure = mo.md("*(CIFAR-10 figure not found)*")
mo.vstack([
_figure,
mo.md(
mo.vstack([
mo.md(
"> **CIFAR-10 comparison (summary)**\n>\n"
"> The original notebook version referenced an external figure here.\n"
"> In this checked-in script we keep the section self-contained and\n"
"> summarize the result directly: blind **noise prediction** produces\n"
"> visibly degraded samples, while blind **velocity prediction**\n"
"> remains clean and stable."
),
mo.md(

Copilot uses AI. Check for mistakes.
# "matplotlib",
# "scipy",
# "scikit-image",
# "pillow",

Copilot AI May 1, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pillow is listed as a dependency, but this notebook doesn't import or use it. Dropping unused dependencies reduces install time and package size (especially in Pyodide).

Suggested change
# "pillow",

Copilot uses AI. Check for mistakes.
Comment on lines +51 to +56
GH_RAW = "https://raw.githubusercontent.com/FarseenSh/alphaxiv-marimo-comp/main/data/gallery.npz"

def _fetch_remote():
with urllib.request.urlopen(GH_RAW) as _r:
return dict(np.load(io.BytesIO(_r.read())))

Copilot AI May 1, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GH_RAW points at the main branch of an external repository. This makes the notebook non-reproducible and fragile (a force-push or file change upstream can break it). Prefer pinning to an immutable commit SHA / release tag URL, or vendoring the .npz into this repository (and loading locally first) to avoid network/upstream availability issues.

Copilot uses AI. Check for mistakes.
Diffusion sampling itself runs offline (~5s per sample on CPU). The
notebook reads the cached samples from a 10 MB `.npz`. *Why?* PyTorch
is not in Pyodide, but everything else here is. To reproduce the
sampling, see `scripts/precompute.py` in the repo.

Copilot AI May 1, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The markdown says "see scripts/precompute.py in the repo", but this repository doesn't have scripts/precompute.py. This is likely a stale reference to another repo; update the reference to the correct path in this repo (or add the script) so readers can actually reproduce the precomputation steps.

Suggested change
sampling, see `scripts/precompute.py` in the repo.
sampling, run the offline precomputation from the project source used to
generate the cached `.npz` file in this notebook.

Copilot uses AI. Check for mistakes.
Comment on lines +38 to +43

import numpy as np
import plotly.graph_objects as go
import traitlets
from pywidget import PyWidget

Copilot AI May 1, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plotly is imported here but never used in the notebook (and it also appears in the script metadata dependencies). This adds unnecessary dependency weight for Pyodide/MoLab and can cause install failures if Plotly isn't available. Remove the plotly.graph_objects import and drop Plotly from the # dependencies list unless it's going to be used.

Copilot uses AI. Check for mistakes.
@ktaletsk

ktaletsk commented May 1, 2026

Copy link
Copy Markdown

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants