8e0dea3d8fa8efecc9b3eaff721f997e08e74e57,deeppavlov/core/commands/train.py,,train_model_from_config,#Any#,46

Before Change



    if callable(getattr(model, "train_on_batch", None)):
        _train_batches(model, dataset, train_config, metrics_functions)
    elif callable(getattr(model, "fit", None)):
        _fit(model, dataset, train_config)
    else:
        "model is not adapted to the experimental_train yet"
        model.train(dataset)
        return

    if train_config["validate_best"] or train_config["test_best"]:
        try:
            model_config["load_path"] = model_config["save_path"]

After Change



def train_model_from_config(config_path: str):
    config = read_json(config_path)
    if "chainer" in config:
        return train_chainer(config_path)

    reader_config = config["dataset_reader"]
    reader = get_model(reader_config["name"])()
    data_path = expand_path(reader_config.get("data_path", ""))
    data = reader.read(data_path)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: deepmipt/DeepPavlov
Commit Name: 8e0dea3d8fa8efecc9b3eaff721f997e08e74e57
Time: 2018-02-25
Author: yoptar@gmail.com
File Name: deeppavlov/core/commands/train.py
Class Name:
Method Name: train_model_from_config


Project Name: apache/incubator-tvm
Commit Name: e6d53185b96cc39f2aaec5e86ae11ca0ac675b8a
Time: 2021-01-25
Author: comaniac0422@gmail.com
File Name: python/tvm/auto_scheduler/workload_registry.py
Class Name:
Method Name: workload_key_to_tensors


Project Name: tensorflow/models
Commit Name: 777107312382e292dadba091de1d2a64998c23b5
Time: 2019-09-30
Author: hongkuny@google.com
File Name: official/modeling/tf_utils.py
Class Name:
Method Name: get_activation