68f81a02c0bef03ba40959580b2415750d2e7f87,autokeras/net_transformer.py,,to_wider_graph,#Any#,8

Before Change



def to_wider_graph(graph):
    weighted_layer_ids = graph.wide_layer_ids()
    if len(weighted_layer_ids) <= 1:
        target_id = weighted_layer_ids[0]
    else:
        target_id = weighted_layer_ids[randint(0, len(weighted_layer_ids) - 1)]

    if is_layer(graph.layer_list[target_id], "Conv"):
        n_add = graph.layer_list[target_id].filters
    else:
        n_add = graph.layer_list[target_id].units

After Change


def to_wider_graph(graph):
    weighted_layer_ids = graph.wide_layer_ids()
    n_wider_layer = randint(1, len(weighted_layer_ids))
    wider_layers = sample(weighted_layer_ids, n_wider_layer)

    for layer_id in wider_layers:
        layer = graph.layer_list[layer_id]
        if is_layer(layer, "Conv"):
            n_add = layer.filters
        else:
            n_add = layer.units

        graph.to_wider_model(layer_id, n_add)
    return graph


def to_skip_connection_graph(graph):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


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


Project Name: chartbeat-labs/textacy
Commit Name: eaaf2bad32af4bda1a98d434530926bb6a001230
Time: 2019-08-23
Author: burtdewilde@gmail.com
File Name: textacy/augmentation/transformations.py
Class Name:
Method Name: insert_synonyms