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
-1
votes
1 answer

MNIST numpy neural network accuracy hovering at 10%

Hi I've been working on a neural network to tackle the MNIST dataset, but when I run the code the accuracy begins to increase but eventually results in 0.098 accuracy, I also encounter an overflow error in exp when calculating the SoftMax values. I…
sebc
  • 11
  • 1
-1
votes
2 answers

How to shuffle MNIST data loaded using Keras?

I am using MNIST dataset from keras - (x_train, y_train), (x_test, y_test) = keras.datasets.mnist.load_data() Before loading the data, how can I shuffle this dataset?
-1
votes
1 answer

Why do we need to pre-process image datasets?

Refer to this Complete guide on How to use Autoencoders in Python Notice the author add: x_train = x_train.astype('float32') / 255. x_test = x_test.astype('float32') / 255. x_train = x_train.reshape((len(x_train), np.prod(x_train.shape[1:]))) x_test…
Michael
  • 439
  • 1
  • 4
  • 15
-1
votes
1 answer

Handwritten Digit Recognition on MNIST dataset using sklearn

I want to build a Handwritten Digit Recognition on MNIST dataset using sklearn and I wanted to shuffle my train set for both features(x) and label(y). But it shows a KeyError. Let me know what is the correct way to do it. from sklearn.datasets…
-1
votes
1 answer

CSV MNIST data set: ValueError: Shapes (None, 10) and (None, 28, 10) are incompatible

I want to classify the MINST data set (csv) with keras. This is my code but after running it I got this error. Do you know how can I solve it ValueError: Shapes (None, 10) and (None, 28, 10) are incompatible from keras import models import numpy as…
ELI
  • 45
  • 7
-1
votes
1 answer

Neural Network is not predicting the correct digit

I am new to ML and for my project, I am trying to make a digit classifier using neural networks. I have made a GUI where you can draw the digit and it will pass the NumPy Array to the neural network. I have trained my neural network with mnist digit…
user10079031
  • 3
  • 1
  • 3
-1
votes
1 answer

TypeError: forward() missing 1 required positional argument: 'c'

I created this simplified version of VGG16: class VGG16COMBO(nn.Module): def __init__(self, num_classes): super(VGG16COMBO, self).__init__() # calculate same padding: # (w - k + 2*p)/s + 1 = o # => p =…
CasellaJr
  • 378
  • 2
  • 11
  • 26
-1
votes
2 answers

AttributeError: 'str' object has no attribute 'reshape'

I'm following an article on medium called Machine Learning: Improving Classification accuracy on MNIST using Data Augmentation and running into issues with the code in the article. The code is as follows: from sklearn.datasets import…
user2027502
  • 149
  • 2
  • 4
-1
votes
1 answer

Accuracy decreasing after iteration in federated learning setting

I am working on a federated learning to detect bad clients. Brief about federated learning - Data is divided into various clients, training is done on client side and the results are then sent by each client to central server where aggregation of…
-1
votes
1 answer

MNIST with TensorFlow-Inputs to a layer should be tensors

I'm trying to exercise the TensorFlow Deep Convolutional Generative Adversarial Network based on the MNIST database. In order to test my coding abilities I downloaded the MNIST database directly from there website(instead of…
Dvir
  • 1
-1
votes
1 answer

Expected input batch_size (500) to match target batch_size (1000)

I am trying to train a CNN in PyTorch on MNIST data. However, I am getting ValueError: Expected input batch_size (500) to match target batch_size (1000). This occurs when I run the test() command in the code below. I have looked up solutions to this…
Vinny Jacobsen
  • 127
  • 2
  • 9
-1
votes
1 answer

matching PyTorch tensor dimensions

I am having some issues with regards to the dimensionality of my tensors in my training function at present. I am using the MNIST dataset, so 10 possible targets, and originally wrote the prototype code using a training batch size of 10, which was…
Thefoilist
  • 137
  • 1
  • 11
-1
votes
1 answer

Will this code work to recognise the MNIST set? (K-NN method)

I'm not sure if the following code will execute as it has been stuck on "Computing Prediction" for a long time. If it will not work what should I change? import struct import matplotlib.pyplot as plt import numpy as np import os from scipy.special…
Kiaan1204
  • 3
  • 2
-1
votes
2 answers

AttributeError when selecting 0s and 1s from MNIST dataset with PyTorch

I am following a guide to build a model to classify between only 0s and 1s from the MNIST dataset. However, what they suggest to do to select 0/1 values is not working for my and raises an error. This is the code I am using: from torch.utils.data…
-1
votes
1 answer

How to replace the softmax layer with sigmoid layer? (Theano, MNIST classification)

I need your help. I am trying to modify the python-based neural network for MNIST data classification developed by M. Nielsen [http://neuralnetworksanddeeplearning.com/index.html]. Particularly, I am using networ3.py script. It employs Theano…
Arsen
  • 131
  • 10