68e0442cd7c9e28e2d1a0ca41dac64297fad858a,autokeras/net_transformer.py,,transform,#Any#,88

Before Change


            graphs.append(to_wider_graph(deepcopy(graph)))
        elif a == 2:
            graphs.append(to_skip_connection_graph(deepcopy(graph)))
    graphs = list(filter(lambda x: x, graphs))
    return list(filter(lambda x: legal_graph(x), graphs))


def default_transform(graph):

After Change


    graphs = []
    for i in range(Constant.N_NEIGHBOURS * 2):
        a = randrange(3)
        temp_graph = None
        if a == 0:
            temp_graph = to_deeper_graph(deepcopy(graph))
        elif a == 1:
            temp_graph = to_wider_graph(deepcopy(graph))
        elif a == 2:
            temp_graph = to_skip_connection_graph(deepcopy(graph))

        if temp_graph is not None and temp_graph.size() <= Constant.MAX_MODEL_SIZE:
            graphs.append(temp_graph)

        if len(graphs) >= Constant.N_NEIGHBOURS:
            break

    return list(filter(lambda x: legal_graph(x), graphs))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: keras-team/autokeras
Commit Name: 68e0442cd7c9e28e2d1a0ca41dac64297fad858a
Time: 2018-08-30
Author: jhfjhfj1@gmail.com
File Name: autokeras/net_transformer.py
Class Name:
Method Name: transform


Project Name: ray-project/ray
Commit Name: 76450c8d4777f12188203e8303d7fd7eb499210c
Time: 2020-05-28
Author: smtp.pdames@gmail.com
File Name: python/ray/autoscaler/aws/config.py
Class Name:
Method Name: _get_security_group


Project Name: keras-team/autokeras
Commit Name: 504d63d25cfd42e650834d8db6d976103e5f4baa
Time: 2018-09-03
Author: jhfjhfj1@gmail.com
File Name: autokeras/net_transformer.py
Class Name:
Method Name: transform