Skip to content

Conversation

@ShindeShivam
Copy link
Contributor

@ShindeShivam ShindeShivam commented Jul 18, 2025

Chapter: 11
Cell: Piecewise Constant Scheduling

Issue:

In the PiecewiseConstantDecay example, the original boundaries were set to [50000, 80000], but with 55,000 training images, batch size 32, and 10 epochs, total training steps are only about:

55000 / 32 × 10 ≈ 17,190 steps

The model never reaches the first boundary, and the learning rate never decays.

So,I changed:
boundaries=[50_000, 80_000],

to:
boundaries=[6000, 13_000],

Hope this PR might be meaningful.

I’ve also opened a few other PRs recently ->

#202
#205

@ageron
Copy link
Owner

ageron commented Aug 10, 2025

Oh great catch, thanks! I'll look at the implications for the book, then I'll merge. 👍

@ageron
Copy link
Owner

ageron commented Aug 10, 2025

It looks like there's no reference in the book, that's a relief. However, readers might not understand why we're doing this, so could you please use this code instead?

boundaries=[50_000 * n_epochs // batch_size, 80_000 * n_epochs // batch_size],

@ShindeShivam
Copy link
Contributor Author

My Mac is currently in for repair, so I’m updating this directly from my phone. This is my first time pushing changes from mobile.
Hope this works.

@ageron ageron merged commit 6164577 into ageron:main Oct 13, 2025
@ageron
Copy link
Owner

ageron commented Oct 13, 2025

Thanks again @ShindeShivam

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