ajrcampbell / early-exit-ensembles

Early exit ensembles
MIT License
12 stars 2 forks source link

Loss function doesn't match paper #3

Closed Krasner closed 6 months ago

Krasner commented 1 year ago

Hi,

ExitWeightedCrossEntropyLoss doesn't match the loss function described in Equation 8. Specifically that equation doesn't have the term gamma: loss += self.alpha[ex] * gamma[ex] * F.cross_entropy(exit_logits, labels) In run.py the gamma argument isn't provided: loss = criterion(logits, y) but the call method for this function expects it:

def __call__(self, logits, labels, gamma):

Additionally, I don't see an implementation of diversity loss in equation 9.

Can you also upload the hydra config yaml file?

Thanks!

ajrcampbell commented 1 year ago

Hi @Krasner,

The gamma term in the loss function is left over from experiments that were not included in final paper. In the yaml file, that I will commit, it is simply set to 1. It should really be removed. Sorry for the confusion.

We removed the diversity loss as it negatively impacted the final results when beta>0. See the caption of Table 2.

Thanks!