0e8ec93b28ecd86898b3668d48d346f510e95167,pl_examples/domain_templates/computer_vision_fine_tuning.py,TransferLearningModel,validation_epoch_end,#TransferLearningModel#Any#,308

Before Change



        val_loss_mean = torch.stack([output["val_loss"]
                                     for output in outputs]).mean()
        val_acc_mean = torch.stack([output["num_correct"]
                                    for output in outputs]).sum().float()
        val_acc_mean /= (len(outputs) * self.batch_size)
        return {"log": {"val_loss": val_loss_mean,
                        "val_acc": val_acc_mean,
                        "step": self.current_epoch}}

After Change


        Compute and log validation loss and accuracy at the epoch level.

        val_loss_mean = torch.stack([output["val_loss"] for output in outputs]).mean()
        train_acc_mean = self.valid_acc.compute()
        log_dict = {"val_loss": val_loss_mean, "val_acc": train_acc_mean}
        self.log_dict(log_dict, prog_bar=True)
        self.log_dict({"step": self.current_epoch})
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 3

Instances


Project Name: williamFalcon/pytorch-lightning
Commit Name: 0e8ec93b28ecd86898b3668d48d346f510e95167
Time: 2021-01-06
Author: jspaezp@users.noreply.github.com
File Name: pl_examples/domain_templates/computer_vision_fine_tuning.py
Class Name: TransferLearningModel
Method Name: validation_epoch_end


Project Name: williamFalcon/pytorch-lightning
Commit Name: 0e8ec93b28ecd86898b3668d48d346f510e95167
Time: 2021-01-06
Author: jspaezp@users.noreply.github.com
File Name: pl_examples/domain_templates/computer_vision_fine_tuning.py
Class Name: TransferLearningModel
Method Name: training_epoch_end


Project Name: cmu-db/ottertune
Commit Name: 01b4ec3f531e07b8c4a32a13288c963ad8b4b843
Time: 2019-10-14
Author: dvanaken@cs.cmu.edu
File Name: server/website/website/db/base/parser.py
Class Name: BaseParser
Method Name: convert_dbms_metrics


Project Name: cmu-db/ottertune
Commit Name: 01b4ec3f531e07b8c4a32a13288c963ad8b4b843
Time: 2019-10-14
Author: dvanaken@cs.cmu.edu
File Name: server/website/website/db/myrocks/parser.py
Class Name: MyRocksParser
Method Name: convert_dbms_metrics