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]

    if len(dense_layers) == 0:
        weighted_layers = conv_layers
    elif randint(0, 1) == 0:
        weighted_layers = conv_layers
    else:
        weighted_layers = dense_layers

    if len(weighted_layers) <= 1:

After Change


    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: 4

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: deepmipt/DeepPavlov
Commit Name: 0066f83bc6f9f3861119db2593c3007796d2056c
Time: 2018-08-30
Author: mary.vikhreva@gmail.com
File Name: deeppavlov/metrics/bleu.py
Class Name:
Method Name: per_item_bleu


Project Name: asyml/texar
Commit Name: 99153ad034108b7d0e759fc246cb3d05593ee897
Time: 2018-06-02
Author: zhitinghu@gmail.com
File Name: texar/agents/pg_agent.py
Class Name: PGAgent
Method Name: _train_policy


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