From 3c59cde2c508e54623eaba3ac4a665a6e50b0d7f Mon Sep 17 00:00:00 2001 From: dayhaha <18800111918@163.com> Date: Wed, 8 Feb 2017 11:56:37 +0000 Subject: [PATCH] add normalization in predict.py --- recognize_digits/predict.py | 1 + 1 file changed, 1 insertion(+) diff --git a/recognize_digits/predict.py b/recognize_digits/predict.py index e89b32f..0a6c87b 100644 --- a/recognize_digits/predict.py +++ b/recognize_digits/predict.py @@ -46,6 +46,7 @@ class Prediction(): self.network.loadParameters(model_dir) self.images, self.labels = read_data(data_dir, "t10k") + self.images = self.images / 255.0 * 2.0 - 1.0 # normalized to [-1,1] slots = [dense_vector(28 * 28)] self.converter = DataProviderConverter(slots) -- GitLab