且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

TensorFlow:将类添加到预训练的初始模型中输出完整图像层次结构

更新时间:2023-12-02 20:55:40

1)输出层是softmax,这意味着它具有预定义数量的神经元,每个神经元是为一个特定的类定义的.从技术上讲,您可以执行网络手术,以便在输出层中有一个神经元来代表您的新班级.但是您将必须对网络进行额外的培训,以便它更新其所有权重以考虑新课程.坏消息-由于更新会影响整个网络并且该网络是巨大的,因此可能需要一些时间.好消息-预先训练的现有网络中的此类变化将比从头开始学习一切更快.

1) Output layer is softmax, which means it has predefined number of neurons, each one is defined for one specific class. Technically you could perform Network Surgery so that it has one more neuron in output layer which will represent your new class. But you will have to perform additional training of your network so that it updates all of its weights in order to account for new class. Bad news - it could take a while since update will affect whole network and the network is GIANT. Good news - such change in pretrained existing network will be faster than learning everything from scratch.

2)是什么让您认为这样的层次结构完全存在?您肯定对数据的内部表示一无所知.当然,您可以检查每个功能中神经元的激活,甚至可以将它们可视化……但是您将不得不尝试自己理解这些激活的含义.可能您将找不到期望看到的任何层次结构.综上所述-了解ANN如何在内部表示数据绝非易事.实际上-非常困难.

2) What makes you think that such hierarchy exists at all? You can't know anything about internal representation of data for sure. Of course, you can inspect activations of neurons in each of the functions and even visualize them... But you will have to try to understand what these activations mean on your own. And probably you won't find any hierarchy which you expect to see. So to sum up - understanding how ANN represents data internally is no easy task. Actually - extremely difficult one.

建议进一步阅读: https://github.com/tensorflow/models/tree/master/inception

请注意文档的这一部分-与您的#1紧密相关

Pay attention to this part of the doc - it is strongly related to your #1