tweaked MNIST DBN test to allow for filtered down training records to only a subset of labels for testing purposes