Преглед на файлове

Transpose outputs of sample loading

In order to keep dimensions as in the lab description.
DricomDragon преди 5 години
родител
ревизия
8064c8acc6
променени са 1 файла, в които са добавени 3 реда и са изтрити 3 реда
  1. 3 3
      python/lab/io_mnist.py

+ 3 - 3
python/lab/io_mnist.py

@@ -5,8 +5,8 @@ def load_training_samples():
 	"""
 	Return np_images, np_expected
 	where
-	np_impages is a np.array of 60 000 x 784
-	np_expected is a np.array of 60 000 x 10
+	np_impages is a np.array of 784 x 60 000
+	np_expected is a np.array of 10 x 60 000
 	"""
 	mndata = MNIST('../../resources/download')
 
@@ -25,4 +25,4 @@ def load_training_samples():
 	for k, label in enumerate(labels):
 		np_expected[k][label] = 1.0
 
-	return np_images, np_expected
+	return np.transpose(np_images), np.transpose(np_expected)