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,

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})

    def configure_optimizers(self):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

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: githubharald/SimpleHTR
Commit Name: a91b4632b2e85bc3d0df94381562546db7a194b5
Time: 2021-02-17
Author: harald@newpc.com
File Name: src/Model.py
Class Name: Model
Method Name: inferBatch