我指的是keras documentation来构建一个网络,该网络以嵌入和其他一些重要功能的形式接受多个输入。但是,如果我们已经定义了主要损失,那么我不理解辅助损失的确切影响。
Here we insert the auxiliary loss, allowing the LSTM and Embedding layer to be trained smoothly even though the main loss will be much higher in the model.
如文档中所述,我假设它有助于在嵌入/之前定义的任何其他层上进行平滑训练。我的问题是,如何确定辅助损失的权重。
We compile the model and assign a weight of 0.2 to the auxiliary loss. To specify different loss_weights or loss for each different output, you can use a list or a dictionary.
如果有人能解释有关如何确定损失权重以及辅助损失权重的较高/较低值对模型训练和预测有何影响,我将不胜感激。
最佳答案
这是一个非常有趣的问题。辅助分类器的想法并不像人们想象的那么普遍。例如在Inception体系结构中。在此答案中,我将尝试向您提供一些直觉,以了解为何此调整实际上可以帮助培训:
从我上面写的内容可以推断出如何设置辅助损失权重的一些提示:
关于neural-network - 深度网络在多输入多输出模型中辅助输出的意义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43216513/