Repository navigation
Conversation
Rework the digit domain-adaptation tutorial.ipynb into a self-contained, lightweight notebook that runs top-to-bottom on a free CPU and opens directly in Google Colab: - Inline the config and model build; no sibling imports (config.py/model.py/configs), so Colab -- which loads only the .ipynb -- can run it. - Clean Colab install cell: pip install "pykale[image]" matplotlib, no-op elsewhere. - Plain-language narrative; ~3 epochs on a data subset (a few minutes on CPU). - Verified end-to-end headless: runs with no errors, USPS target accuracy ~0.73. Wire the site to it: tutorial_actions points Colab/Notebook at each example's own tutorial.ipynb and enables the buttons per-tutorial when that file exists (conf.py checks for it), so the rollout to the other examples is one notebook at a time. 96 tests pass; validate and the strict -W build are green.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proof-of-concept for lightweight, self-contained tutorial notebooks that run from the tutorial webpage and Google Colab — starting with the digit domain-adaptation example. One example now; the pattern rolls out to the rest one notebook at a time.
What this does
others/image_classification/digit_domain_adaptation/tutorial.ipynbto inline its config and model build and drop every sibling import (config.py,model.py,configs/tutorial.yaml). Colab loads only the.ipynb, so it previously could not run; now it can.git clone … cd examples/digits_danncell withpip install "pykale[image]" matplotlib(a no-op off Colab).main.pyfor real numbers.tutorial_actionsnow points Colab / Download-Notebook at each example's owntutorial.ipynb, andconf.pyenables those buttons per-tutorial when the file exists. Examples without a notebook keep a disabled button with a reason — so this is additive and the rollout is incremental.Publish target
Each example's notebook lives in its own folder (
<example>/tutorial.ipynb), beside the narrative and example code.Verification
96tests pass;validateand the strict-W --keep-goingbuild are green.Notes
main(URL isblob/main/…).plot_*.py) is unchanged; whether to converge on a single source (narrative ⇄ notebook) to avoid drift is a follow-up decision before the full rollout.Draft for review.