Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

code is called twice #6

Open
shunsuke0-byte opened this issue Jun 10, 2024 · 2 comments
Open

code is called twice #6

shunsuke0-byte opened this issue Jun 10, 2024 · 2 comments

Comments

@shunsuke0-byte
Copy link

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?

@shashank3009
Copy link

I think the first self.evaluate should be self.train_df (and not self.val_df) since we are already doing that below. And that is the reason why the train and val accuracy are coming the same. I have modified that part in my code.

@shunsuke0-byte
Copy link
Author

thanks for reply :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants