facebookresearch / EGG

EGG: Emergence of lanGuage in Games
MIT License
281 stars 99 forks source link

Losses #200

Closed robertodessi closed 3 years ago

robertodessi commented 3 years ago

Adding code for 3 standard losses: reconstruction, discriminative, ntxent (contrastive).

Description

Adding 3 standard losses as class objects.

Motivation and Context

Common losses in emergent communication games are contrastive and discriminative loss. Most of the games in EGG used either of the two. Adding them in core so that it will be easier to implement a new game from scratch. No more need to implement a discriminative loss (a potential source of wasted time handling tensor dimensions between sender messages and processed receiver input) as it can be imported from core in one line.

TODOs (potential)

rewrite some games with such standard losses

robertodessi commented 3 years ago

Thanks a lot for the review! @eugene-kharitonov I'll merge once I can write some proper doc and testing