Vector programming replaces all explicit for loops with vector operations.
In the previous section, we used a small dataset of 512*512*10. The patch we took was very small (8*8) And we learned very little about the features (25 ), I commented out the gradient verification (lazy), so the program ran out in 1 minute (I5 processor ).
But in fact, we have encountered too many problems than this. A slightly larger dataset, such as mnist, is a subset of another larger handwritten database NIST, including 60000 training examples and 10000 test samples, all images are standardized and centralized, and the image size is fixed (28*28 ).
Input
images= loadMNISTImages('train-images-idx3-ubyte');display_network(images(:,1:100));
Look at the first 100 pictures of mnist.
Figure 1
The image changes, and the nodes of the visible and hidden layers must change. Here, modify the parameters:
visibleSize= 28*28;hiddenSize= 196;sparsityParam= 0.1;lambda= 3e-3;beta= 3;images= loadMNISTImages('train-images.idx3-ubyte');patches=images(:,1:10000);
Since my code in the previous section is already code after vectoring, we can use it directly here. Andrew said: "ourimplementation takes around 15-20 minutes on a fast machine. "I felt that it was almost the same. If there was no vectoring, it would be hard to get results all morning.
After the operation, it took more than 10 minutes to launch the product, and the keyboard was slightly burned.
Figure 2
Welcome to the discussion and follow up on this blog, Weibo, and zhihu personal homepage for further updates ~
Reprinted, please respect the work of the author and keep the above text and link of the article completely. Thank you for your support!