667d856a2fc27732d745cd7d926e9739ad12995c,example/ctr/ctr/train.py,,train,#,183

Before Change


        elif args.role == "trainer" or args.role == "TRAINER":
            logger.info("download the training materials")
            file_index = args.trainer_id % 10
            address = "https://paddle-ctr-data.bj.bcebos.com/dac" + str(file_index) + ".tar.gz"
            cmd = "cd /workspace/ctr/data/ && curl -o dac.tar.gz " + address + " && tar zxf dac.tar.gz && rm dac.tar.gz"
            exit_code = subprocess.call(cmd, shell=True)
            if exit_code != 0:
                raise Exception("The download command failed, please check the network settings")

After Change


        // comma separated ips of all pservers, needed by trainer and

        args.endpoints = os.getenv("PADDLE_PSERVERS", "")
        ep_list = args.endpoints.split(",")
        args.trainers = int(os.getenv("PADDLE_TRAINERS_NUM", "1"))
        args.pserver_id = int(os.getenv("PADDLE_PSERVER_ID", "0"))
        for ep in ep_list:
            if os.getenv("POD_IP", "localhost") in ep:
                args.current_endpoint = ep
                break
        args.role = os.getenv("TRAINING_ROLE", "TRAINER")
        args.trainer_id = int(os.getenv("PADDLE_TRAINER_ID", "0"))
        args.is_local = bool(int(os.getenv("PADDLE_IS_LOCAL", 0)))
    if args.is_local:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: PaddlePaddle/edl
Commit Name: 667d856a2fc27732d745cd7d926e9739ad12995c
Time: 2019-09-28
Author: wangjiawei04@baidu.com
File Name: example/ctr/ctr/train.py
Class Name:
Method Name: train


Project Name: michaelhush/M-LOOP
Commit Name: 6e5cf676b113af8d70e34224f23bc8eace618856
Time: 2017-05-02
Author: harry.slatyer@gmail.com
File Name: mloop/nnlearner.py
Class Name: SingleNeuralNet
Method Name: fit


Project Name: jindongwang/transferlearning
Commit Name: 2733bef356c53286d475a67476d88d4840923830
Time: 2020-09-30
Author: jindongwang@outlook.com
File Name: code/deep/finetune_AlexNet_ResNet/finetune_office31.py
Class Name:
Method Name: finetune