Exercise:Self-Taught Learning

From Ufldl

Jump to: navigation, search
Line 25: Line 25:
===Step Three: Training the logistic regression model===
===Step Three: Training the logistic regression model===
-
After the sparse autoencoder is trained, we can use it to detect pen strokes in images. To do so, you will need to modify the sparse autoencoder function to output its hidden unit activation.
+
After the sparse autoencoder is trained, we can use it to detect pen strokes in images. To do so, you will need to be able to save the sparse autoencoder function to output its hidden unit activation.
-
Change the method signature of sparseAutoencoderCost from
+
Fill in <tt>feedForwardSparseAutoencoder.m</tt> to produce a matrix whose columns correspond to activation of the hidden layer for each example i.e. the vector <math>a^{(2)}</math> corresponding to activation of layer <math>L_{2}</math>.
-
<tt>function [cost, grad] = sparseAutoencoderCost(...)</tt> to <tt>function [cost, grad, activation] = sparseAutoencoderCost(...)</tt> where activation should be a matrix with each column corresponding to activation of the hidden layer i.e. the vector <math>a^{(2)}</math> corresponding to activation of layer <math>L_{2}</math>. The remainder of the function should remain unchanged.
+
-
After doing so, this step will use your modified function to convert the raw image data to feature unit activations. It will then train the softmax regression model on the hidden unit activation and labels.
+
After doing so, this step will use your modified function to convert the raw image data to feature unit activations. It will then train the softmax regression model on the hidden unit activation and labels with <tt>trainSoftmax.m</tt>.
===Step Four: Training and testing the logistic regression model===
===Step Four: Training and testing the logistic regression model===

Revision as of 03:31, 5 May 2011

Personal tools