dbl_val: 0.05 name: "dropout5" dbl_val: 0.05 name: "dropout6" dbl_val: 0.05 name: "regularizer1" dbl_val: 0.0001 name: "regularizer2" dbl_val: 0.0001 name: "regularizer3" dbl_val: 0.0001 name: "regularizer4" dbl_val: 0.0001 """ select_gpu() params = [ 10, 10, 10, 10, 10, 10, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.0001, 0.0001, 0.0001, 0.0001 ] x_train, y_train, x_test, y_test = get_data() X = np.concatenate((x_train, x_test)) Y = np.concatenate((y_train, y_test)) k_fold = StratifiedKFold(n_splits=10, shuffle=False, random_state=7) ret = [] y_stub = np.random.randint(0, 10, X.shape[0]) for train, test in k_fold.split(X, y_stub): ret.append(cnn(params, (X[train], Y[train], X[test], Y[test]))) print(np.array(ret))
def run(params): print('Start time: ', datetime.datetime.now()) result = cnn(params, get_data()) print('Result: ', params, result) print('End time: ', datetime.datetime.now()) return result
from examples.cnn.mnist.mnist import get_data from examples.cnn.cnn import cnn, select_gpu select_gpu() for width in [64, 128, 256]: for dropout in [0.25, 0.5]: for regularizer in [0.01, 0.001]: params = [width * 1.0] * 6 + [dropout] * 6 + [regularizer] * 4 print(params) cnn(params, get_data())
def run(params): print('Start time: ', datetime.datetime.now()) result = cnn(params, get_data(), Conv1D, MaxPooling1D, True, True) print('Result: ', params, result) print('End time: ', datetime.datetime.now()) return result