Skip to content

Fix errors and modernize keras and jax_nn lectures#302

Merged
mmcky merged 2 commits intomainfrom
nns_misc_edits
Apr 9, 2026
Merged

Fix errors and modernize keras and jax_nn lectures#302
mmcky merged 2 commits intomainfrom
nns_misc_edits

Conversation

@jstac
Copy link
Copy Markdown
Contributor

@jstac jstac commented Apr 7, 2026

Summary

  • Fix miscellaneous errors and modernize the keras and jax_nn neural network lectures

Changes

keras.md

  • Fix validation bug: validation data was using the same seed as training data (seed=1234), so "validation" was evaluating on identical data. Changed to seed=5678
  • Fix incorrect terminology: replaced "cross-validation" with "validation" throughout (the lecture does a train/validation split, not k-fold cross-validation)
  • Modernize NumPy RNG: replaced legacy np.random.seed / np.random.randn with modern np.random.default_rng / rng.standard_normal API
  • Fix heading level: "Regression model" was ## (h2) but should be ### (h3) under the "Models" h2, matching its sibling "Deep Network"
  • Remove duplicate code: removed second identical definition of plot_results
  • Fix typos: "adds a single layer the activation" → "with the", "train our models" → "train our models", "In a a follow-up" → "In a follow-up"
  • Fix spelling: "Tensorflow" → "TensorFlow"
  • Move Keras backend note: moved the detailed troubleshooting note about KERAS_BACKEND from jax_nn.md to here, where the backend is first introduced

jax_nn.md

  • Fix incorrect description: parameters are stored as "named tuples" not "dictionaries" (two occurrences)
  • Fix typos: "of a the network" → "of the network", "corresponding to" → "corresponding to", "since will not" → "since we will not"
  • Fix capitalization: "ADAM" → "Adam" throughout (it's not an acronym — the original paper styles it "Adam")
  • Modernize type hints: replaced deprecated jnp.ndarray with jax.Array throughout
  • Remove unnecessary f-string: f"Training NN using Keras.""Training NN using Keras."
  • Extract reusable plotting function: added plot_jax_output to replace three identical scatter+line plot blocks; placed after f and loss_fn definitions so it follows its dependencies
  • Simplify plot_keras_output: removed unused x, y parameters
  • Clean up TODO comments: removed leftover development notes in summary table code
  • Move Keras backend note: moved to keras.md where it belongs

Test plan

  • Converted keras.md to Python via jupytext and ran successfully

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 7, 2026

Deploy Preview for incomparable-parfait-2417f8 ready!

Name Link
🔨 Latest commit 134e6a6
🔍 Latest deploy log https://app.netlify.com/projects/incomparable-parfait-2417f8/deploys/69d5a1aab6b4970008e35fb6
😎 Deploy Preview https://deploy-preview-302--incomparable-parfait-2417f8.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@jstac
Copy link
Copy Markdown
Contributor Author

jstac commented Apr 7, 2026

@mmcky please review and make live when ready. Thanks!

@mmcky
Copy link
Copy Markdown
Contributor

mmcky commented Apr 8, 2026

Reviewed — all changes look correct. Fixed the CI error: plot_jax_output had curly/smart quotes (U+2018, U+2019) instead of ASCII quotes in Python string literals, causing the lexer failure. Pushed a fix.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

@github-actions github-actions bot temporarily deployed to pull request April 8, 2026 00:40 Inactive
@mmcky
Copy link
Copy Markdown
Contributor

mmcky commented Apr 9, 2026

thanks @jstac. Merging this now.

@mmcky mmcky merged commit b8bab59 into main Apr 9, 2026
7 checks passed
@mmcky mmcky deleted the nns_misc_edits branch April 9, 2026 06:47
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.

2 participants