141316fb2911df0475554e66798441855cc08b1b,pl_examples/domain_templates/computer_vision_fine_tuning.py,TransferLearningModel,configure_optimizers,#TransferLearningModel#,197

Before Change


        self.log("val_acc", self.valid_acc(y_logits, y_true.int()), prog_bar=True)

    def configure_optimizers(self):
        optimizer = optim.Adam(filter(lambda p: p.requires_grad, self.parameters()), lr=self.lr)

        scheduler = MultiStepLR(optimizer, milestones=self.milestones, gamma=self.lr_scheduler_gamma)

        return [optimizer], [scheduler]

After Change


            f"The model will start training with only {len(trainable_parameters)} "
            f"trainable parameters out of {len(parameters)}."
        )
        optimizer = optim.Adam(trainable_parameters, lr=self.lr)
        scheduler = MultiStepLR(optimizer, milestones=self.milestones, gamma=self.lr_scheduler_gamma)
        return [optimizer], [scheduler]

    @staticmethod
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 3

Instances


Project Name: williamFalcon/pytorch-lightning
Commit Name: 141316fb2911df0475554e66798441855cc08b1b
Time: 2021-02-16
Author: thomas@grid.ai
File Name: pl_examples/domain_templates/computer_vision_fine_tuning.py
Class Name: TransferLearningModel
Method Name: configure_optimizers


Project Name: ray-project/ray
Commit Name: 244aafdcf89ae814975c8c4e3faf0bd4995c7878
Time: 2020-09-05
Author: sven@anyscale.io
File Name: rllib/utils/exploration/curiosity.py
Class Name: Curiosity
Method Name: get_exploration_optimizer


Project Name: keras-team/keras
Commit Name: 08f6bdeb5652550f36210f64aefda3d0d41e2d79
Time: 2019-05-28
Author: tanzheny@google.com
File Name: tests/keras/optimizers_test.py
Class Name:
Method Name: test_adam


Project Name: ray-project/ray
Commit Name: 59bc1e6c093fb6fa3b55c5830c5cf4063b2647e0
Time: 2020-11-12
Author: michael.luo123456789@gmail.com
File Name: rllib/agents/maml/maml_torch_policy.py
Class Name:
Method Name: maml_optimizer_fn