Skip to content
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

load_data() module #43

Open
Auth0rM0rgan opened this issue May 8, 2018 · 3 comments
Open

load_data() module #43

Auth0rM0rgan opened this issue May 8, 2018 · 3 comments

Comments

@Auth0rM0rgan
Copy link

Auth0rM0rgan commented May 8, 2018

Hey, Thanks for gathering all the CNN model + ImageNet Pretrained Models in a repo. I am curious about load_data() module. It would be nice if you can explain more or add some code how to write load_data() module. For example, there are two folders which one for training images and one for test images. How am I going to write load_data() module?

Thanks.

@HwaiHo-0552
Copy link

I also want to get the load_data() module.......
Thanks.

@GreatNewHope
Copy link

This code might serve as an example:

def load_data():
    # load the dataset (it's a normal numpy array, samples x features (features = channel x width x height))
    dataset = np.load("dataset.npy") 
    # load the targets (they must be one hot encoded; np.array([1,0]) rather than 1
    targets = np.load("targets.npy")
    # select training and validation / test
    x_train = src_dataset[:-1, :, :]
    y_train = targets[:-1, :, :]

    x_test = src_dataset[-1:, :, :]
    y_test = targets[-1:, : , :]

    y_train = np.reshape(y_train, (len(y_train), 1))
    y_test = np.reshape(y_test, (len(y_test), 1))

    return (x_train, y_train), (x_test, y_test)

Please correct me if something is wrong or it could lead to any errors

@HwaiHo-0552
Copy link

@margaro95 Could you share the source code that load my own dataset ? I am a fresher. Thank you very much.

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

No branches or pull requests

3 participants