f9d0d6c62c94d08c583e52cc4b08634b31df3f06,pytext/trainers/trainer.py,Trainer,__init__,#Trainer#Any#Any#,89

Before Change


        scheduler: Optional[Scheduler.Config] = None

    def __init__(self, config: Config, model: torch.nn.Module):
        self.optimizer: torch.optim.Optimizer = precision.wrap_optimizer(
            create_optimizer(config.optimizer, model)
        )
        self.scheduler: torch.optim.lr_scheduler = (
            create_scheduler(config.scheduler, self.optimizer)
            if config.scheduler

After Change


        scheduler: Optional[Scheduler.Config] = None

    def __init__(self, config: Config, model: torch.nn.Module):
        optimizer: torch.optim.Optimizer = create_optimizer(config.optimizer, model)
        self.scheduler: torch.optim.lr_scheduler = (
            create_scheduler(config.scheduler, optimizer)
            if config.scheduler
            else Scheduler()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: facebookresearch/pytext
Commit Name: f9d0d6c62c94d08c583e52cc4b08634b31df3f06
Time: 2019-05-16
Author: barlaso@fb.com
File Name: pytext/trainers/trainer.py
Class Name: Trainer
Method Name: __init__


Project Name: facebookresearch/pytext
Commit Name: 4c89fd66ec992359a5e515b3a948db1193d4b1c2
Time: 2019-05-13
Author: chenyangyu@instagram.com
File Name: pytext/trainers/trainer.py
Class Name: Trainer
Method Name: __init__


Project Name: HyperGAN/HyperGAN
Commit Name: 10ea0209b3503ceee0aadea48e3949061baa4c6b
Time: 2018-12-30
Author: mikkel@255bits.com
File Name: hypergan/trainers/alternating_trainer.py
Class Name: AlternatingTrainer
Method Name: _create