在尝试udacity课程深度学习任务时,我遇到了将模型的预测与训练集的标签进行比较的问题.
from __future__ import print_function
import numpy as np
import tensorflow as tf
from six.moves import cPickle as pickle
from six.moves import range
pickle_file = 'notMNIST.pickle'
with open(pickle_file, 'rb') as f:
save = pickle.load(f)
train_dataset = save['train_dataset']
train_labels = save['train_labels']
valid_dataset = save['valid_dataset']
valid_labels = save['valid_labels']
test_dataset = save['test_dataset']
test_labels = save['test_labels']
del save # hint to help gc free up memory
print('Training set', train_dataset.shape, train_labels.shape)
print('Validation set', valid_dataset.shape, valid_labels.shape)
print('Test set', test_dataset.shape, test_labels.shape)
Run Code Online (Sandbox Code Playgroud)
这使输出为:
训练集(200000,28,28)(200000,)
验证集(10000,28,28)(10000,)
测试集(10000,28,28)(10000,)
# With …Run Code Online (Sandbox Code Playgroud) python comparison numpy machine-learning logistic-regression