This past week, I finally got access to the Argon Cluster. To interact with this set of computers at the University of Iowa, I went over basic Linux commands that I can use in Terminal. After logging into the Argon system, I had to switch from a login node to a compute node. Login nodes are shared across any and all users logged into Argon and can only be used to complete basic tasks. On the other hand, compute nodes are more useful where I can upload my code and run specific jobs.
After running into some bugs in my code last week, I spent the majority of this week trying to work through those issues. I started from the top of my code and worked my way downward. Here are a few things I learned while inspecting my code:
to_categorical: This R command represents each numerical digit as a binary matrix. Each of the rows represents 1 separate digit. For example, in the picture below, yTrain is composed of the binary matrix equivalents of mnist$train$y. The first element in mnist$train$y is 5 as shown below and the 6th column of the first row (of yTrain) is marked with a 1, indicating that the first row represents 5. (Since there are 10 digits, the index 1 corresponds to the digit 0, index 2 corresponds to the digit 1, and so on so forth)
glmnet: This function applies a logistic regression to the x (image of the handwritten digit) and y (label of the x data, for example “1” or “5”) in order to determine the most significant portions of each image. “Significant” in this context means that this is the portion of the image (of the numerical digit) that differentiates it from images of other digits. The majority of my week was spent debugging this function since I found that my data was formatted incorrectly. It should’ve been in a 3D array (12*12*6), but it turned out to be in a 4D array. Therefore, I’ve been working on reformatting the data and determining the best ways to apply this function to my data. The syntax for the glmnet function is as follows:
glmnet(x, y, family = “multinomial”, lambda = 0.15)
In the above function, family can be “gaussian,” “binomial,” “poisson,” “multinomial,” “cox,” or “mguassian.” For my project, I’m using “multinomial.” Lambda is a sparsity control parameter used to control how many significant areas of each picture I get. I am using the value 0.15 for lambda in hopes of striking the best balance between interpretability and accuracy of the network.
Lastly, since the glmnet function was the one that was giving me the most issues, I read up on logistic regression by following a blog called “Eight to Late.” It helped me dig into logistic regression and specifically, lasso regularization, which I’m using in my project.
Be sure to check back next week for more updates 🙂