深度学习预测温度 [英] Deep learning to predict the temperature
问题描述
假设我有一个训练数据.我针对1,2,3,4,5度的整数温度训练模型.基本上,这些输出温度是标签.如何预测介于两个温度(例如2.5度)之间的值.不可能针对每个温度值进行训练.我该如何实现?
Let's say I have a training data. I train the model for whole number temperatures like 1,2,3,4,5 degrees. Basically, Those output temperatures are the labels. How can I predict the values that lies between two temperatures like 2.5 degree. It is not possible to train for every values of temperature. How can I achieve this?
推荐答案
它好像已经训练成离散分类,但是却想要连续输出,因此很容易受伤.切换算法以进行回归,而不是分类.
It wounds as if you've trained to a discrete classification, but you want continuous output. Switch your algorithm to do regression, rather than classification.
另一种可能性是利用您的最后一层输出进行插值.使用赋予最优先选择权和最强邻近选择权的权重.例如,如果您的分类给出
Another possibility is to harness your last-layer output to interpolate. Use the weights given to the top choice and its strongest adjacent choice. For instance, if your classification gives
1 .01
2 .05
3 .56
4 .24
5 .14
...您将对56个部分3
和24个部分4
进行插值,以得到3.7 degrees
作为您的输出.
... you would interpolate with 56 parts 3
and 24 parts 4
, to get 3.7 degrees
as your output.
有帮助吗?
更新
(1)如何从分类切换到回归?
对于堆栈溢出来说,这个范围太广了;您需要先进行研究.两者之间的区别并非微不足道.您需要提出一个具体的问题,这需要发布一个新问题,其中包括您当前的代码以及您进行切换的工作.
This is far too broad for Stack Overflow; you need to do your research first. The difference between the two is not trivial. You would need to ask a specific question, which requires posting a new question that includes your current code and your work toward making the switch.
(2)当我根据输出预测值时,如何知道我正在寻找3.7度...?
在预测时,您不会知道;那将是培训的问题.我举的例子只是一个可能结果的说明.我发明了一个示例,因为您没有提供有关数据的详细信息.
While you're predicting, you don't know; that would have been an issue for training. The example I gave is just an illustration of a possible result. I invented an example, since you gave no details on your data.
(3)我应该选择哪个部分?
我建议您最先猜测(这将是您的整数值分类),并且比较有可能使用相邻的值.在我的示例中,3
是最常见的猜测.您查看2
和4
,发现4
比2
更有可能,因此将4
用作插值的另一个端点.
I recommended that you take the top guess (the one that would have been your integer-value classification), and the more probable of the adjacent values. In my example, 3
is the top guess. You look at 2
and 4
, and see the 4
is more likely than 2
, so use 4
for the interpolation's other endpoint.
这篇关于深度学习预测温度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!