简体   繁体   English

Keras在用于反向传播的多个输出的多个损耗中找到最佳损耗

[英]Keras Finding the best loss among multiple losses from multiple outputs for backpropagation

I am using a multiple output model in keras for a regression problem. 我在keras中使用多输出模型来解决回归问题。

For example the model is like : 例如,模型如下:

model = Model(inp, [out1, out2, out3])

I want to calculate loss of each output but based on each loss, select one and backpropagate only through that and make every other weights 0. It is like a loss that finds the best loss and output among all loss and learns only through that output. 我想计算每个输出的损失,但要根据每个损失选择一个,然后通过它进行反向传播,并将其他权重设为0。这就像在所有损失中找到最佳损失和输出并仅通过该输出学习的损失。

For example, out 1 loss was minimum, so my weight will be [1.0, 0.0, 0.0],so that model will not learn anything from out2 and out3. 例如,输出1的损失最小,因此我的体重将是[1.0,0.0,0.0],因此该模型将不会从输出2和输出3中学习任何信息。

size of out1, out2 and out3 are same. out1,out2和out3的大小相同。

I am not so experienced with keras, is there any way to do it. 我对keras不太了解,有没有办法做到这一点。

Thanks for the help. 谢谢您的帮助。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM