4cf94b4f157424e41be9cd4f45a9d0b3cf1bbfe5,dlpy/applications.py,,VGG16,#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#,573

Before Change


            if n_classes != 1000:
                warnings.warn("If include_top = True, n_classes will be set to 1000.", RuntimeWarning)
            model = Model.from_table(model_cas)
            label_table = random_name("label")
            label_file = os.path.join(os.path.dirname(__file__),
                                      "datasources", "imagenet_label.sas7bdat")
            conn.upload(
                casout=dict(replace=True, name=label_table),
                data=label_file)

            model.load_weights(path=pre_train_weight_file,
                               labeltable=dict(name=label_table,
                                               varS=["levid", "levname"]))
            model._retrieve_("table.droptable", table=label_table)
            return model

        else:
            model = Model.from_table(model_cas, display_note=False)

After Change


        // something like pytorch style

        if pre_trained_weights_file is None:
            raise DLPyError("\nThe pre-trained weights file is not specified.\n"
                            "Please follow the steps below to attach the pre-trained weights:\n"
                            "1. go to the website https://support.sas.com/documentation/prod-p/vdmml/zip/ "
                            "and download the associated weight file.\n"
                            "2. upload the *.h5 file to "
                            "a server side directory which the CAS session has access to.\n"
                            "3. specify the pre_trained_weights_file using the fully qualified server side path.")

        model_cas = model_vgg16.VGG16_Model(s=conn, model_table=model_table, n_channels=n_channels,
                                            width=width, height=height, random_crop=random_crop, offsets=offsets)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 17

Instances


Project Name: sassoftware/python-dlpy
Commit Name: 4cf94b4f157424e41be9cd4f45a9d0b3cf1bbfe5
Time: 2018-10-25
Author: Ethem.Can@sas.com
File Name: dlpy/applications.py
Class Name:
Method Name: VGG16


Project Name: sassoftware/python-dlpy
Commit Name: 4cf94b4f157424e41be9cd4f45a9d0b3cf1bbfe5
Time: 2018-10-25
Author: Ethem.Can@sas.com
File Name: dlpy/applications.py
Class Name:
Method Name: ResNet101_Caffe


Project Name: sassoftware/python-dlpy
Commit Name: 4cf94b4f157424e41be9cd4f45a9d0b3cf1bbfe5
Time: 2018-10-25
Author: Ethem.Can@sas.com
File Name: dlpy/applications.py
Class Name:
Method Name: VGG19


Project Name: sassoftware/python-dlpy
Commit Name: 4cf94b4f157424e41be9cd4f45a9d0b3cf1bbfe5
Time: 2018-10-25
Author: Ethem.Can@sas.com
File Name: dlpy/applications.py
Class Name:
Method Name: ResNet50_Caffe


Project Name: sassoftware/python-dlpy
Commit Name: 4cf94b4f157424e41be9cd4f45a9d0b3cf1bbfe5
Time: 2018-10-25
Author: Ethem.Can@sas.com
File Name: dlpy/applications.py
Class Name:
Method Name: VGG16