Skip to content

optimizers.sgd returns inconsistent results #14687

Answered by mattjj
toan-vt asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for the question! Could you share a fully runnable repro?

As you can see from the code, the sgd update isn't doing much.

It's hard to guess without having a repro, but it could just be standard precision loss from floating point accumulation. If so, you may be able to reorder the computations to be more stable, but an easy way to check would be to set jax.config.update('jax_enable_x64', True) at the top of your file and see if the answers change.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@toan-vt
Comment options

@mattjj
Comment options

@toan-vt
Comment options

Answer selected by toan-vt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants