Hello,
I want to train a multitask network with 2 outputs, the first one with CE metric, and the second one with Cosine Similarity. I tried the following codes:
model.compile(loss='categorical_crossentropy', 'cosine_proximity') , but it seems to me both tasks are optimized with both metrics, thus 4 losses are printed out(task1 ce, task1 cosine, task2 ce, task 2 cosine). I wonder how to let task 1 only be optimized by CE, and task 2 only be optimized by Cosine (task1 ce, task2 cosine)?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 30 days if no further activity occurs, but feel free to re-open a closed issue if needed.
Taken from def compile of keras/engine/training.py
To specify different metrics for different outputs of a multi-output model, you could also pass a dictionary, such as metrics={'output_a': 'accuracy'}.
Most helpful comment
Taken from
def compileofkeras/engine/training.pyTo specify different metrics for different outputs of a multi-output model, you could also pass a dictionary, such as
metrics={'output_a': 'accuracy'}.