Coder Social home page Coder Social logo

jatinshah / ufldl_tutorial Goto Github PK

View Code? Open in Web Editor NEW
692.0 692.0 334.0 1.58 MB

Stanford Unsupervised Feature Learning and Deep Learning Tutorial

License: MIT License

Python 100.00%
convolutional-neural-networks deep-learning deep-learning-tutorial

ufldl_tutorial's People

Contributors

jatinshah avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ufldl_tutorial's Issues

During the exercise, I got this issue...

File "........\load_MNIST.py", line 18, in load_MNIST_images
images = images.reshape((num_images, num_rows * num_cols)).transpose()
ValueError: total size of new array must be unchanged

Sparse autoencoder sample image exercise got wrong output image

I modified train.py like this to do sample image exercise:
"
visible_size = 8 * 8
hidden_size = 25
......

patches = sample_images.sample_images()
"
but I got wrong output, any suggestion? Thank you!
I also tried
"
sparsity_param = 0.01
lambda_ = 1e-3
beta = 3
"
like what ufldl tutorial suggested, but the output is still wrong!

very slow computation

Hi guys,,

have you the problem of terrified slow computation when run the line

num_grad = gradient.compute_gradient(J, theta) % line 101 in train.py

It has already taken more than 12 hours and only finished 34700 inputs.
Do I run the code not in a right way? Thanks

Filters are transposed compared to Matlab version

Matlab mnist images are stored column major order, whereas this version stores them in row major. This means that when transferring weights between Python and Matlab implementations, you need to reshape/transpose/flatten each row of the first layer weights matrix

ValueError

when I run the train.py,I get the following error
images = images.reshape((num_images[0], num_rows[0] * num_cols[0])).transpose()
Traceback (most recent call last):
File "/home/snow/Documents/study/ufldl_tutorial/train.py", line 42, in
images = load_MNIST.load_MNIST_images('data/mnist/train-images-idx3-ubyte')
File "/home/snow/Documents/study/ufldl_tutorial/load_MNIST.py", line 20, in load_MNIST_images
images = images.reshape((num_images[0], num_rows[0] * num_cols[0])).transpose()
ValueError: cannot reshape array of size 9912406 into shape (2055376946,1902539786)

#####code begin
with open(filename, "rb") as f:
magic = np.fromfile(f, dtype=np.dtype('>i4'), count=1)

    num_images = np.fromfile(f, dtype=np.dtype('>i4'), count=1)
    num_rows = np.fromfile(f, dtype=np.dtype('>i4'), count=1)
    num_cols = np.fromfile(f, dtype=np.dtype('>i4'), count=1)
    #num_images = 60000
    #num_rows = 28
    #num_cols = 28
    images = np.fromfile(f, dtype=np.ubyte)
    images = images.reshape((num_images[0], num_rows[0] * num_cols[0])).transpose()
    images = images.astype(np.float64) / 255

    f.close()

#####code end

I google the http://yann.lecun.com/exdb/mnist/
find the value:
0004 32 bit integer 60000 number of images
0008 32 bit integer 28 number of rows
0012 32 bit integer 28 number of columns

by calculating the value, I find 282860000 larger than the 9912422,that makes me so confused,
How can I correct the code?

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.