b048efa4f956b80266942caea6ee8b4311e1d17a,autokeras/net_transformer.py,,to_wider_graph,#Any#,9

Before Change


        The wider model
    
    // The last conv layer cannot be widen since wider operator cannot be done over the two sides of flatten.
    conv_layers = list(filter(lambda x: is_conv_layer(x), graph.layer_list))[:-1]
    // The first layer cannot be widen since widen operator cannot be done over the two sides of flatten.
    // The last layer is softmax, which also cannot be widen.
    dense_layers = list(filter(lambda x: is_dense_layer(x), graph.layer_list))[1:-1]

After Change


    Returns:
        The wider model
    
    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_conv_layer(graph.layer_list[target_id]):
        n_add = randint(1, 4 * graph.layer_list[target_id].filters)
    else:
        n_add = randint(1, 4 * graph.layer_list[target_id].units)

    graph.to_wider_model(target_id, n_add)
    return graph
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: keras-team/autokeras
Commit Name: b048efa4f956b80266942caea6ee8b4311e1d17a
Time: 2018-04-08
Author: jin@tamu.edu
File Name: autokeras/net_transformer.py
Class Name:
Method Name: to_wider_graph


Project Name: keras-team/autokeras
Commit Name: b048efa4f956b80266942caea6ee8b4311e1d17a
Time: 2018-04-08
Author: jin@tamu.edu
File Name: autokeras/net_transformer.py
Class Name:
Method Name: to_skip_connection_graph


Project Name: dmlc/gluon-nlp
Commit Name: 03b0e7061cf477fbeccb9c128ee76603df582d86
Time: 2018-09-04
Author: leonard@lausen.nl
File Name: scripts/word_embeddings/evaluate_pretrained.py
Class Name:
Method Name: load_embedding_from_path