Code Monkey home page Code Monkey logo

Comments (2)

symoon11 avatar symoon11 commented on July 18, 2024

I uploaded training dataset(4000 images) and test dataset(1000 images).
Each dataset consists of 3 gz files(image, label-digit, label-color) and has the same format as the ordinary MNIST dataset.

When you use the dataset

  1. Unzip the datasets.
  2. Each file is a byte code. So you have to change it to integer. Here is an example of decoding the datasets.

import numpy as np
from struct import *

images = open('test-images-ubyte', 'rb')
digits = open('test-label-digit-ubyte', 'rb')
colors = open('test-label-color-ubyte', 'rb')

for i in range(4000):
    image_byte = images.read(28 * 28 * 3)
    digit_byte = digits.read(1)
    color_byte = colors.read(3)

    image = np.reshape(unpack(len(image_byte) * 'B', image_byte), [28, 28, 3])
    digit = unpack(len(digit_byte) * 'B', digit_byte)
    color = unpack(len(color_byte) * 'B', color_byte)

Then, you can get an image and the corresponding digit and color,
Note that digit is not a one-hot vector, but a scalar value.

If there is any problem with the datasets, feel free to contact me.
Thanks.

from conditional-similarity-network-mnist.

peternara avatar peternara commented on July 18, 2024

@drillermoon I try it!! thanks :) I appreciate the code you have also released.

from conditional-similarity-network-mnist.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.