pytorch神经网络
Imagine you are a radiologist working in this new high-tech hospital. Last week you got your first neural-network based model to assist you making diagnoses given your patients data and eventually improving your accuracy. But wait! Very much like us humans, synthetic models are never 100% accurate in their predictions. But how do we know if a model is absolutely certain or if it just barely surpasses the point of guessing? This knowledge is crucial for right interpretation and key for selecting appropriate treatment.
我想像一下您是在这家新高科技医院工作的放射科医生。 上周,您获得了第一个基于神经网络的模型,可帮助您根据患者数据进行诊断,并最终提高准确性。 可是等等! 就像我们人类一样,合成模型的预测永远不会100%准确。 但是,我们怎么知道一个模型是绝对确定的,还是仅仅超过了猜测点呢? 这些知识对于正确的解释至关重要,也是选择适当治疗方法的关键。
Assuming you’re more of an engineer: This scenario is also highly relevant for autonomous driving where a car constantly has to make decisions whether there is an obstacle in front of it or not. Ignoring uncertainties can get ugly real quick here.
假设您更多地是工程师:这种情况也与自动驾驶高度相关,在自动驾驶中,汽车必须不断做出决策,确定前方是否有障碍物。 在这里忽略不确定性会变得很丑陋。
If you are like 90% of the Deep Learning community (including past me) you just assumed that the predictions produced by the Softmax functionrepresent probabilities since they are neatly squashed into the domain [0,1]. This is a popular pitfall since these predictions generally tend to be overconfident. As we’ll see soon this behaviour is affected by a variety of architectural choices like the use of Batch Normalization or the number of layers.
如果您像90%的深度学习社区(包括我之前)一样,您只是假设Softmax函数产生的预测代表概率,因为它们被巧妙地压入了域[0,1]。 这是一个普遍的陷阱,因为这些预测通常倾向于过于自信。 我们很快就会看到,这种行为受到各种体系结构选择的影响,例如使用批处理规范化或层数。
You can find a interactive Google Colab notebook with all the code here.
您可以在此处找到带有所有代码的交互式Google Colab笔记本。
可靠性图 (Reliability Plots)
As we know now, it is desirable to output calibrated confidences instead of their raw counterparts. To get an intuitive understanding of how well a specific architecture performs in this regard, Realiability Diagramms are often used.
众所周知,希望输出经过校准的置信度而不是原始的置信度。 为了直观地了解特定体系结构在这方面的性能,经常使用Realiability Diagramms 。