Skip to content

Mnist dataset: where is the image "normalized"? #602

Answered by zachgk
hmf asked this question in Q&A
Discussion options

You must be logged in to vote

I mentioned another option for how you could create an Mnist variant in #601 (reply in thread), but this should also work fine.

For the normalization, you really just need a division by 255. So, you can add that as a transform like you are thinking with new Pipeline().addTransform(a -> a.div(255f)).addTransform(new ToTensor()). You can also add a LambdaBlock to your model as well, but I think the transform is a slightly nicer approach.

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@zachgk
Comment options

@hmf
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@hmf
Comment options

Answer selected by hmf
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