简体   繁体   English

为什么一个输入比另一个输入具有更大的权重

[英]Why does one input have much more weight than another

I am using the simple getting started network in Pybrain. 我正在使用Pybrain中的简单入门网络。 I trained it with my data (about 200 data points). 我用我的数据(大约200个数据点)对其进行了训练。 This data is 2 inputs and one output. 该数据为2输入1输出。

I did a test where I kept one input the same and iterated over a range of conceivable values for the other input. 我做了一个测试,我将一个输入保持不变,并对另一个输入的一系列可能值进行迭代。 The output was the same throughout the possible values of the second input. 在第二个输入的所有可能值中,输出都是相同的。 I had to go 234.17 times higher than the highest possible value to get it to change. 我必须比可能的最高值高234.17倍才能更改它。

I also did a test where i kept the second input the same and only changed the first one. 我还做了一个测试,我将第二个输入保持不变,只更改了第一个输入。 The output only changed for the first 0.12% of the possible data values for the first input. 对于第一个输入,输出仅更改了可能数据值的前0.12%。

Do I simply need to train the network with more data, or do I need to do something different with the way the network is set up? 我只是需要用更多的数据训练网络,还是需要对网络的设置方式做一些不同的事情?

Edit: 编辑:

Here is the code that sets up the NN and returns the prediction for one value: 这是设置NN并返回一个值的预测的代码:

net = buildNetwork(2, 3, 1)
ds = SupervisedDataSet(2, 1)
for each in train_data:
    ds.addSample((each[0], each[1]), (each[2],)) #adds training data to Data Set
print len(ds)
trainer = BackpropTrainer(net, ds) #sets up trainer
print trainer.trainUntilConvergence(maxEpochs=2000, verbose=True) #Trains
print net.activate([(1420884000%86400),51.74]) #print prediction

One input is the time of day (in seconds since midnight). 一个输入是一天中的时间(自午夜以来的秒数)。 The other input is current temperature. 另一个输入是当前温度。 The output should be the predicted temperature in an arbitrary time based on the training data. 输出应该是根据训练数据在任意时间内的预测温度。

I get better results with neural networks if the inputs are all scaled to be between 0 and 1, with the maximum possible value (or guaranteed largest value in that dataset) as 1 and the minimum as 0. 如果所有输入都缩放到0到1之间,并且可能的最大值(或该数据集中的保证最大值)为1,最小值为0,则使用神经网络可以获得更好的结果。

This is particularly a good idea when there are multiple inputs, as there usually are, so that it is not as difficult for the network to start with roughly equal weight given to the two different inputs. 当有多个输入(通常有多个输入)时,这是一个特别好的主意,因此对于网络来说,从赋予两个不同输入大致相等的权重开始并不困难。 The objectively smaller input might be more important for the system in question, and scaling both inputs to be between 0 and 1 makes this easier to achieve. 客观上来说,较小的输入对于所讨论的系统可能更为重要,将这两个输入缩放到0到1之间将使其更容易实现。

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

相关问题 为什么 meshgrid 比输入多一维? - Why does meshgrid have one more dimension than input? 为什么一种方法比另一种方法更有效? - Why is one way more efficient than another? 为什么Javascript的阻塞函数比Python少很多 - Why does Javascript have much fewer blocking functions than Python 为什么嵌套循环比扁平循环执行得快得多? - Why does a nested loop perform much faster than the flattened one? 为什么readlines()读取的内容远大于sizehint? - Why is readlines() reading much more than the sizehint? 为什么 Pandas 数据帧消耗的 RAM 比原始文本文件的大小多得多? - Why does a pandas dataframe consumes much more RAM than the size of the original text file? 为什么存储为字典的文件比文件占用更多的空间 - Why does a file stored as a dictionary take up much more space than file 为什么FP-Growth返回不止一个结果? - Why does FP-Growth return more than one Consequent? python如何在内部工作? 是不是一个python的解释器可以使CPU使用率太高? - How python works internally? Does more than one interpreter of python can make CPU usage too much high? 为什么 pytorch 需要的 memory 比它应该的多得多? - Why pytorch needs much more memory than it should?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM