You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When there's a lot of addto_layers in a network, it will takes exponential parsing time.
E.G. 1:
def whole_network(src_embedding):
enc = src_embedding
for i in range(depth):
enc = addto_layer([enc, enc])
pred = fc_layer(input=fc_layer(
input=enc,
size=dim_embedding,
act=ReluActivation()
),
size=label_dict_len,
act=SoftmaxActivation())
return pred
E.G. 2:
def whole_network(src_embedding):
enc = src_embedding
for i in range(depth):
enc_res = fc_layer(input=enc, size=dim_embedding)
enc_res = fc_layer(input=enc_res, size=dim_embedding)
enc = addto_layer([enc, enc_res])
pred = fc_layer(input=fc_layer(
input=enc,
size=dim_embedding,
act=ReluActivation()
),
size=label_dict_len,
act=SoftmaxActivation())
return pred
Both will costs a huge amount of time to parse (test by the nest_diagram tool).
My parsing time:
* FixPaddlePaddle#2797
* It because trainer_config_helpers' __dfs_travel__ did not record the
node which travelled, and if the topology has a recursive dependency,
there are some nodes will be travelled multiple times.
* Add a `travelled` set to record which node is travelled.
* Also add a unittest for this situation.
When there's a lot of addto_layers in a network, it will takes exponential parsing time.
E.G. 1:
E.G. 2:
Both will costs a huge amount of time to parse (test by the nest_diagram tool).
My parsing time:
The text was updated successfully, but these errors were encountered: