-
Notifications
You must be signed in to change notification settings - Fork 42
VGG'11 model on FashionMNIST dataset #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@Craigacp and @karllessard please have a look |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks.
this.imageSize = trainingImages.get(0).shape().size(); | ||
} | ||
|
||
private static ByteNdArray readArchive(String archiveName) throws IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use the mnist loader here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but I tried don't touch the MNISTDataset code here. The best idea - to refactor (convert path to archives to paramters in constructor, for example). In this way, it will have the common loader parametrized by path
import org.tensorflow.framework.optimizers.Optimizer; | ||
import org.tensorflow.model.examples.mnist.data.ImageBatch; | ||
import org.tensorflow.op.Ops; | ||
import org.tensorflow.op.core.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer no star imports in the example code too, @karllessard what do you think?
@@ -22,7 +22,7 @@ | |||
import org.tensorflow.tools.ndarray.ByteNdArray; | |||
import org.tensorflow.tools.ndarray.index.Index; | |||
|
|||
class ImageBatchIterator implements Iterator<ImageBatch> { | |||
public class ImageBatchIterator implements Iterator<ImageBatch> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should probably have a little bit of documentation if they are public.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree
@Craigacp @karllessard I fixed comments in this repository codestyle. What do you think? |
Hey @zaleslaw , sorry for the late reply, looks good on my side, I'm ok with this new organization. The only comment is that the I did not went in deep analysis of your VGG model though but I trust you there ;) Wdyt @Craigacp ? |
@karllessard I'll fix the package structure according your comment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we ok to redistribute MNIST and FashionMNIST?
@@ -0,0 +1,50 @@ | |||
/* | |||
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't want an Oracle copyright at the top.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, thanks!
ByteNdArray trainingLabels = readArchive(TRAINING_LABELS_ARCHIVE); | ||
ByteNdArray testImages = readArchive(TEST_IMAGES_ARCHIVE); | ||
ByteNdArray testLabels = readArchive(TEST_LABELS_ARCHIVE); | ||
ByteNdArray trainingImages = readArchive(trainingImagesArchive); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe there should be two methods here, one for MNIST and one for FashionMNIST? Then we don't have to carry around the string constants in all the classes that use them. This method can remain if people want to load in the extra MNIST test data from last years NeurIPS by supplying their own downloaded version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe, but I've copied an existing approach, from my perspective for examples the best way to have them as a resources.
I think that is a fair question. When I've dropped the MNIST dataset in the resource folder at first, it was kind of a temporary solution until we write a simple HTTP client to download it instead. Now by adding this new dataset, we are getting closer to crystallize this hack as something permanent, which I would prefer we avoid before the project grows too much... So if you are ready to tackle this @zaleslaw , it would be great to change the data loader to use an HTTP client instead and remove the datasets from the resource folder. Wdyt? |
@karllessard I could switch and return to MNIST to run the VGG model and remove Fashion MNIST but I'm not ready now to write http loader. My point of view - that resources is the best place to keep small datasets for examples, it's not a hack, it's a feature:) if datasets are small like MNIST and FashionMNIST. Maybe I'm wrong about datasets keeping, and we could separate it on two parts - merge this and create a ticket for HTTP loader? What do you think, guys? |
I'd be happy to redistribute them if we have the rights to do so, but it's a legal question not a convenience one. |
@karllessard I've repaired the license in code files and checked license for FashionMNIST dataset I suggest to merge PR and create the separate ticket for HTTP client to obtain datasets from the web |
Related to the issue #11