Skip to content

code is called twice #6

Description

@shunsuke0-byte

Hello,
Could you explain why the self.evaluate(model, self.val_dl) is called twice in the code?

            self.evaluate(model, self.val_dl)
            tr_acc, tr_f1 = self.calc_results_per_run()
            # logging
            self.logger.debug(f'[Epoch : {epoch}/{self.hparams["num_epochs"]}]')
            for key, val in loss_avg_meters.items():
                self.logger.debug(f'{key}\t: {val.avg:2.4f}')
            self.logger.debug(f'TRAIN: Acc:{tr_acc:2.4f} \t F1:{tr_f1:2.4f}')

            # VALIDATION part
            self.evaluate(model, self.val_dl)
            ts_acc, ts_f1 = self.calc_results_per_run()

Additionally, on the terminal, I see the following output:

image
Why are the accuracy (Acc) and F1 scores for both train and val exactly the same?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions