我试图使用nolearn运行一个简单的自动编码器。
import nolearn
from nolearn.dbn import DBN
from sklearn.cross_validation import train_test_split
data=np.load('doc_user_matrix.npy')
print (data.shape) #outputs: (10000,500)
(x_train, x_test, y_train, y_test)=train_test_split(data,data,test_size = 0.33)
hidden_layer=10
ae = DBN([x_train.shape[0], hidden_layer, x_train.shape[0]],
learn_rates = 0.3,
learn_rate_decays = 0.9,
epochs = 10)
ae.fit(x_train, x_train)由于某些原因,我遇到了这个错误:
ValueError:不良输入形状(10000,500)
有谁能解释为什么会发生这个错误,以及如何解决呢?
发布于 2015-12-13 16:22:54
通常,第二个维度对应于特征,而第一个维度对应于实例。尝试:
[x_train.shape[1], hidden_layer, x_train.shape[1]]https://stackoverflow.com/questions/34251933
复制相似问题