added train_set function

Added function train_set - makes a training set based on the
opened/closed directories and then runs the NN training algorithm to get
the Theta parameters that minimize the cost function.