简体   繁体   English

为什么scikit神经网络会自动重塑我的输入数组?

[英]Why does scikit neural network reshape my input array automatically?

When I pass my training data to the scikit neural network it is a NumPy array of all my 24*24 image matrices. 当我将训练数据传递到scikit神经网络时,它是我所有24 * 24图像矩阵的NumPy数组。 I check and this is the shape of the data: (3237, 24, 24) - 3237 24*24 images. 我检查了一下,这是数据的形状:(3237,24,24)-3237 24 * 24图像。

However, once I feed it into the neural network, I get this warning: 但是,一旦将其输入到神经网络中,就会收到以下警告:

WARNING:sknn: - Reshaping input array from (3237, 24, 24) to (2589, 24, 24, 1). 警告:sknn:-将输入数组从(3237、24、24)重塑为(2589、24、24、1)。

The program still runs, I just don't understand why it is reshaping my array. 该程序仍在运行,我只是不明白为什么它会重塑数组。

Looking at the source, scikit will reshape input arrays if the X (input samples) you pass in when initializing is a different size from creating/splitting the dataset in the MLP backend. 从源头上看,如果在初始化时传入的X(输入样本)的大小与在MLP后端中创建/拆分数据集的大小不同,则scikit将重塑输入数组。 This is to reduce overfitting by training and validating on the same samples. 这是通过对相同样本进行训练和验证来减少过度拟合。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM