cff50d785a5fddd1fc8722fd993b63d4978da381,models/models.py,ModelBuilder,build_encoder,#ModelBuilder#Any#Any#Any#,74

Before Change


        if arch == "resnet18":
            orig_resnet = resnet.__dict__["resnet18"](pretrained=pretrained)
            net_encoder = Resnet(orig_resnet)
        elif arch == "resnet18_dilated8":
            orig_resnet = resnet.__dict__["resnet18"](pretrained=pretrained)
            net_encoder = ResnetDilated(orig_resnet,
                                        dilate_scale=8)
        elif arch == "resnet18_dilated16":
            orig_resnet = resnet.__dict__["resnet18"](pretrained=pretrained)
            net_encoder = ResnetDilated(orig_resnet,
                                        dilate_scale=16)
        elif arch == "resnet34":
            raise NotImplementedError
            orig_resnet = resnet.__dict__["resnet34"](pretrained=pretrained)
            net_encoder = Resnet(orig_resnet)
        elif arch == "resnet34_dilated8":
            raise NotImplementedError
            orig_resnet = resnet.__dict__["resnet34"](pretrained=pretrained)
            net_encoder = ResnetDilated(orig_resnet,
                                        dilate_scale=8)
        elif arch == "resnet34_dilated16":
            raise NotImplementedError
            orig_resnet = resnet.__dict__["resnet34"](pretrained=pretrained)
            net_encoder = ResnetDilated(orig_resnet,
                                        dilate_scale=16)
        elif arch == "resnet50":
            orig_resnet = resnet.__dict__["resnet50"](pretrained=pretrained)
            net_encoder = Resnet(orig_resnet)
        elif arch == "resnet50_dilated8":
            orig_resnet = resnet.__dict__["resnet50"](pretrained=pretrained)
            net_encoder = ResnetDilated(orig_resnet,
                                        dilate_scale=8)
        elif arch == "resnet50_dilated16":
            orig_resnet = resnet.__dict__["resnet50"](pretrained=pretrained)
            net_encoder = ResnetDilated(orig_resnet,
                                        dilate_scale=16)
        elif arch == "resnet101":
            orig_resnet = resnet.__dict__["resnet101"](pretrained=pretrained)

After Change



    def build_encoder(self, arch="resnet50dilated", fc_dim=512, weights=""):
        pretrained = True if len(weights) == 0 else False
        arch = arch.lower()
        if arch == "resnet18":
            orig_resnet = resnet.__dict__["resnet18"](pretrained=pretrained)
            net_encoder = Resnet(orig_resnet)
        elif arch == "resnet18dilated":
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: CSAILVision/semantic-segmentation-pytorch
Commit Name: cff50d785a5fddd1fc8722fd993b63d4978da381
Time: 2018-11-28
Author: zhaohang0124@gmail.com
File Name: models/models.py
Class Name: ModelBuilder
Method Name: build_encoder


Project Name: probcomp/bayeslite
Commit Name: 4c3aae7ea4e8fea6e0979899e8f9a84825211e67
Time: 2015-10-05
Author: gremio@acm.org
File Name: src/codebook.py
Class Name:
Method Name: bayesdb_load_codebook_csv_file


Project Name: regel/loudml
Commit Name: aecf2630d05e06351315ad0ae696f0b87178c279
Time: 2018-02-01
Author: vianney@redmintnetwork.fr
File Name: loudml-influx/loudml/influx.py
Class Name:
Method Name: _build_agg