我开始学习如何使用带有千层面的theano,并从mnist示例开始.现在,我想尝试一下我自己的例子:我有一个train.csv文件,其中每一行以0或1开头,代表正确的答案,然后是773 0和1代表输入.我不明白如何将此文件转换为load_database()函数中所需的numpy数组.这是mnist数据库的原始函数的一部分:
...
with gzip.open(filename, 'rb') as f:
data = pickle_load(f, encoding='latin-1')
# The MNIST dataset we have here consists of six numpy arrays:
# Inputs and targets for the training set, validation set and test set.
X_train, y_train = data[0]
X_val, y_val = data[1]
X_test, y_test = data[2]
...
# We just return all the arrays in order, as expected in main().
# (It doesn't matter how we do this as long as we can read them again.)
return …Run Code Online (Sandbox Code Playgroud)