Questions tagged [mnist]

MNIST is a database of handwritten digits collected by Yann Lecun and widely used in machine learning research.

MNIST is a database of handwritten digits collected by Yann Lecun, a famous computer scientist, when he was working at AT&T-Bell Labs on the problem of automation of check readings for banks. The data set is a benchmark widely used in machine learning research. Due to its small size it is also widely used for educational purposes.

Here is the full documentation for MNIST database of handwritten digits:

It is a good database for people who want to try learning techniques and pattern recognition methods on real-world data while spending minimal efforts on preprocessing and formatting.

1329 questions
16
votes
2 answers

Tensorflow weight initialization

Regarding the MNIST tutorial on the TensorFlow website, I ran an experiment (gist) to see what the effect of different weight initializations would be on learning. I noticed that, against what I read in the popular [Xavier, Glorot 2010] paper,…
Herbert
  • 5,279
  • 5
  • 44
  • 69
16
votes
4 answers

Display MNIST image using matplotlib

I am using tensorflow to import some MNIST input data. I followed this tutorial...https://www.tensorflow.org/get_started/mnist/beginners I am importing them as so... from tensorflow.examples.tutorials.mnist import input_data mnist =…
buydadip
  • 8,890
  • 22
  • 79
  • 154
14
votes
3 answers

How to freeze weights in certain layer with Keras?

I am trying to freeze the weights of certain layer in a prediction model with Keras and mnist dataset, but it does not work. The code is like: from keras.layers import Dense, Flatten from keras.utils import to_categorical from keras.models import…
david
  • 842
  • 2
  • 8
  • 25
13
votes
5 answers

Correct way of normalizing and scaling the MNIST dataset

I've looked everywhere but couldn't quite find what I want. Basically the MNIST dataset has images with pixel values in the range [0, 255]. People say that in general, it is good to do the following: Scale the data to the [0,1] range. Normalize the…
Euler_Salter
  • 3,271
  • 8
  • 33
  • 74
12
votes
4 answers

How to improve digit recognition of a model trained on MNIST?

I am working on handprinted multi-digit recognition with Java, using OpenCV library for preprocessing and segmentation, and a Keras model trained on MNIST (with an accuracy of 0.98) for recognition. The recognition seems to work quite well, apart…
youngpanda
  • 416
  • 1
  • 4
  • 13
12
votes
3 answers

How to import pre-downloaded MNIST dataset from a specific directory or folder?

I have downloaded the MNIST dataset from LeCun site. What I want is to write the Python code in order to extract the gzip and read the dataset directly from the directory, meaning that I don't have to download or access to the MNIST site anymore.…
Joshua
  • 409
  • 1
  • 4
  • 12
12
votes
4 answers

Mnist recognition using keras

How can I train the model to recognize five numbers in one picture. The code is as follows: from keras.layers import Conv2D from keras.layers import MaxPooling2D from keras.layers import Flatten from keras.layers import Dropout, Dense, Input from…
12
votes
2 answers

Debugging a Neural Network

TLDR I have been trying to fit a simple neural network on MNIST, and it works for a small debugging setup, but when I bring it over to a subset of MNIST, it trains super fast and the gradient is close to 0 very quickly, but then it outputs the same…
11
votes
5 answers

Scikit-learn - Cannot load MNIST Original dataset using fetch_openml in Python

I'm trying to load the MNIST Original dataset in Python. The sklearn.datasets.fetch_openml function doesn't seem to work for this. Here is the code I'm using- from sklearn.datasets import fetch_openml dataset = fetch_openml("MNIST Original") I…
Inglorion
  • 171
  • 2
  • 2
  • 10
11
votes
3 answers

How do I select only a specific digit from the MNIST dataset provided by Keras?

I'm currently training a Feedforward Neural Network on the MNIST data set using Keras. I'm loading the data set using the format (X_train, Y_train), (X_test, Y_test) = mnist.load_data() but then I only want to train my model using digit 0 and 4 not…
sherry
  • 111
  • 1
  • 1
  • 3
11
votes
2 answers

How to do transfer learning for MNIST dataset?

I have been trying to use transfer learning for MNIST dataset using VGG/Inception. But both of these networks accept images of atleast 224x224x3 size. How can i rescale the 28x28x1 MNIST images to 224x224x3 to do transfer learing?
user1159517
  • 5,390
  • 8
  • 30
  • 47
11
votes
3 answers

How to put my dataset in a .pkl file in the exact format and data structure used in "mnist.pkl.gz"?

I'm trying to use the Theano library in python to do some experiments with Deep Belief Networks. I use the code in this address: DBN full code. This code use the MNIST Handwritten database. This file is already in pickle format. It is unpicked in:…
John Krit
  • 544
  • 1
  • 6
  • 20
10
votes
0 answers

HTTP Error 503: Service Unavailable when trying to download MNIST data

I'm trying to run code that I wrote a week ago on Google Colab (and it worked), but I'm getting this error now for some reason. #libraries import torch import torchvision from torchvision import datasets, transforms import torch.nn as…
Penguin
  • 1,923
  • 3
  • 21
  • 51
10
votes
5 answers

Why does using X[0] in MNIST classifier code give me an error?

I was learning to do classification with the MNIST dataset. And I got an error with I am not able to figure out, I have done a lot of google searches and I am not able to do anything, maybe you are an expert and can help me. Here is the code-- >>>…
Arjun Deshwal
  • 103
  • 1
  • 5
10
votes
2 answers

What are the numbers in torch.transforms.normalize and how to select them?

I am following some tutorials and I keep seeing different numbers that seem quite arbitrary to me in the transforms section namely, transform = transforms.Compose([transforms.ToTensor(), transforms.Normalize((0.5,), (0.5,))]) or transform =…
Gulzar
  • 23,452
  • 27
  • 113
  • 201
1
2
3
88 89