diff --git a/hpvm/projects/keras/src/resnet18_cifar10.py b/hpvm/projects/keras/src/resnet18_cifar10.py index 1367c0830bdb96f3d5a310c36ce9022e314eba03..74abc7ad9f860963c770aaa6bea27b7c16d59738 100644 --- a/hpvm/projects/keras/src/resnet18_cifar10.py +++ b/hpvm/projects/keras/src/resnet18_cifar10.py @@ -443,17 +443,32 @@ class ResNet18_CIFAR10(Benchmark): mean = np.mean(X_train) std = np.std(X_train) # X_train = (X_train - mean) / (std + 1e-7) -# X_val = (X_val - mean) / (std + 1e-7) +# X_val = (X_val - mean) / (std + 1e-7) X_train = (X_train - mean) - X_val = (X_val - mean) + X_val = (X_val - mean) + + + X_test_val = np.fromfile(MODEL_PARAMS_DIR + '/resnet18_cifar10/test_input.bin', dtype=np.float32) + Y_test_val = np.fromfile(MODEL_PARAMS_DIR + '/resnet18_cifar10/test_labels.bin', dtype=np.uint32) + + X_test_val = X_test_val.reshape((-1,3,32,32)) + + + X_tune_val = np.fromfile(MODEL_PARAMS_DIR + '/resnet18_cifar10/tune_input.bin', dtype=np.float32) + Y_tune_val = np.fromfile(MODEL_PARAMS_DIR + '/resnet18_cifar10/tune_labels.bin', dtype=np.uint32) + + X_tune_val = X_tune_val.reshape((-1,3,32,32)) + + + X_test = X_test_val[:5000] + y_test= Y_test_val[:5000] + + X_tuner = X_tune_val[:5000] + y_tuner = Y_tune_val[:5000] - X_test = X_val[0:5000] - y_test = y_val[0:5000] - X_tuner = X_val[5000:] - y_tuner = y_val[5000:] return X_train, y_train, X_test, y_test, X_tuner, y_tuner - + def trainModel(self, model, X_train, y_train, X_test, y_test):