CS 5043: HW2

Objectives

Assignment Notes


Data Set

We are using the BMI data set that we discussed in class. It is available on the supercomputer at:
/home/fagg/ml_datasets/bmi/bmi_dataset.pkl

This is a 203MB file - please do not make local copies of the file (you don't need to). You are welcome to copy the file to other machines, if you wish. Two requirements:

The data set contains both neural and arm movement data (the latter being, theta, dtheta, ddtheta and torque). In addition, there is a "time" channel that is a time stamp for each sample. Arm movements are two degrees of freedom, corresponding to the shoulder and elbow, respectively. Each sample of the neural data already contains the history of each neuron over a 1 second period (20 samples at 50ms/sample).

The data are already partitioned into 20 folds for us. Each fold contains multiple blocks of contiguous-time samples. So, if one were to plot theta as a function of time, you would see the motion of the arm over time (with gaps). Across the folds, it is safe to assume that the data are independent of one-another.


Provided Code

I am providing the following code:


Part 1: Network


Part 2: Multiple Runs

Hints

Reading Results Files

import os

def read_all_rotations(dirname, filebase):
    '''Read results from dirname from files matching filebase'''

    # The set of files in the directory
    files = fnmatch.filter(os.listdir(dirname), filebase)
    files.sort()
    results = []

    # Loop over matching files
    for f in files:
        fp = open("%s/%s"%(dirname,f), "rb")
        r = pickle.load(fp)
        fp.close()
        results.append(r)
    return results

Example:

filebase = "bmi_torque_0_hidden_30_drop_0.50_ntrain_%02d_rot_*_results.pkl"
results = read_all_rotations("results", filebase)

will find all files that match this string (* is a wildcard here).


Expectations

Think about what the curve shapes should look like before you generate them.

Looking Forward

For HW 3, we will be experimenting with deeper networks and with varying hyper-parameter choices. As you write your code, think about how to structure it (and your results data structures) so that you can handle variations in other hyper-parameters.


What to Hand-In

Grading


andrewhfagg -- gmail.com

Last modified: Sun Feb 2 00:11:33 2020