简体   繁体   English

如何训练带有负和正元素作为第一层输入的卷积神经网络?

[英]How do I train the Convolutional Neural Network with negative and positive elements as the input of the first layer?

Just I am curious why I have to scale the testing set on the testing set, and not on the training set when I'm training a model on, for example, CNN?! 只是我很好奇,为什么要在例如CNN上训练模型时,必须在测试集上缩放测试集,而不是在训练集上缩放? Or am I wrong? 还是我错了? And I still have to scale it on the training set. 而且我仍然必须根据培训情况进行调整。 Also, can I train a dataset in the CNN that contents positive and negative elements as the first input of the network? 另外,我能否在CNN中训练一个包含正负元素的数据集作为网络的第一个输入? Any answers with reference will be really appreciated. 任何参考的答案将不胜感激。

Scaling data depends upon the requirement as well the feed/data you got. 缩放数据取决于需求以及您获得的提要/数据。 Test data gets scaled with Test data only, because Test data don't have the Target variable (one less feature in Test data). 测试数据仅按测试数据缩放,因为测试数据没有Target变量 (Test数据少了一项功能)。 If we scale our Training data with new Test data, our model will not be able to correlate with any target variable and thus fail to learn. 如果我们用新的测试数据来扩展培训数据,则我们的模型将无法与任何目标变量相关联,从而无法学习。 So the key difference is the existence of Target variable. 因此,关键区别在于Target变量的存在。

We usually have 3 types of datasets for getting a model trained, 我们通常有3种类型的数据集来训练模型,

  1. Training Dataset 训练数据集
  2. Validation Dataset 验证数据集
  3. Test Dataset 测试数据集

Training Dataset 训练数据集

This should be an evenly distributed data set which covers all varieties of data. 这应该是涵盖所有种类数据的均匀分布的数据集。 If your train with more epochs , the model will get used to the training dataset and will only give proper proper prediction on the training dataset and this is called Overfitting . 如果您的火车有更多的时期 ,则该模型将习惯于训练数据集,并且只会对训练数据集进行适当的正确预测,这称为过拟合 Only way to keep a check on overfitting is by having other datasets which the model has never been trained on. 保持过度拟合的唯一方法是拥有从未训练过的其他数据集。

Validation Dataset 验证数据集

This can be used fine tune model hyperparameters 可以使用微调模型超参数

Test Dataset 测试数据集

This is the dataset which the model has not been trained on has never been a part of deciding the hyperparameters and will give the reality of how the model is performing. 这是尚未接受过模型训练的数据集,它从来都不是决定超参数的一部分,并且可以给出模型执行情况的实际情况。

If scaling and normalization is used, the testing set should use the same parameters used during training. 如果使用缩放和归一化,则测试集应使用训练期间使用的相同参数。 A good answer that links to that: https://datascience.stackexchange.com/questions/27615/should-we-apply-normalization-to-test-data-as-well 与此相关的一个很好的答案: https : //datascience.stackexchange.com/questions/27615/should-we-apply-normalization-to-test-data-as-well

Also, some models tend to require normalization and others do not. 同样,某些模型倾向于要求规范化,而其他模型则不需要。 The Neural Network architectures are normally robust and might not need normalization. 神经网络架构通常很健壮,可能不需要标准化。

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

相关问题 卷积神经网络:如何训练? (无监督) - Convolutional neural network: how to train it? (unsupervised) 如何找到神经网络的假阳性率和假阴性率? - How do I find the false positive and false negative rates for a neural network? Python train convolutional neural.network on csv numpy 错误输入形状 - Python train convolutional neural network on csv numpy error input shape 如何使用 OptionsDataset 构建卷积神经网络 - How do I build convolutional neural network using OptionsDataset 如何正确屏蔽卷积神经网络中的值 - How do I properly mask values in my Convolutional Neural Network 如何创建我自己的数据集以训练/测试卷积神经网络 - How to create my own dataset to train/test a convolutional neural network 如何在卷积神经网络(CNN)中获得倒数第二层的值? - How to get values of penultimate layer in convolutional neural network(CNN)? 用theano /烤宽面条训练卷积神经网络 - Train convolutional neural network with theano/lasagne X_train 和 y_train 匹配吗? 卷积神经网络——无分割字符识别 - Do X_train and y_train match? Convolutional Neural Network - Segmentation free character recognition 如何使用 tensorflow 数据集训练神经网络? - How do I train a neural network with tensorflow-datasets?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM