e265c2396f6865e2aa888cecc4e69c5068237550,fairseq/modules/positional_embedding.py,,PositionalEmbedding,#Any#Any#Any#Any#,14

Before Change


            num_embeddings + padding_idx + 1, embedding_dim, padding_idx,
        )
        nn.init.normal_(m.weight, mean=0, std=embedding_dim ** -0.5)
        nn.init.constant_(m.weight[padding_idx], 0)
    else:
        m = SinusoidalPositionalEmbedding(
            embedding_dim, padding_idx, init_size=num_embeddings + padding_idx + 1,
        )

After Change


            num_embeddings = num_embeddings + padding_idx + 1
        m = LearnedPositionalEmbedding(num_embeddings, embedding_dim, padding_idx)
        nn.init.normal_(m.weight, mean=0, std=embedding_dim ** -0.5)
        if padding_idx is not None:
            nn.init.constant_(m.weight[padding_idx], 0)
    else:
        m = SinusoidalPositionalEmbedding(
            embedding_dim, padding_idx, init_size=num_embeddings + padding_idx + 1,
        )
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: elbayadm/attn2d
Commit Name: e265c2396f6865e2aa888cecc4e69c5068237550
Time: 2019-05-18
Author: kartikayk@fb.com
File Name: fairseq/modules/positional_embedding.py
Class Name:
Method Name: PositionalEmbedding


Project Name: open-mmlab/mmcv
Commit Name: 50d2cbdd586b1c76261d7f9f569cbaef18b3f356
Time: 2019-12-12
Author: hanzhipeng9@gmail.com
File Name: mmcv/cnn/weight_init.py
Class Name:
Method Name: constant_init


Project Name: open-mmlab/mmdetection
Commit Name: 25015e1b7efd76cd2a57c4d5da9d02ff270b937b
Time: 2018-12-09
Author: thangvubk@gmail.com
File Name: mmdet/models/bbox_heads/convfc_bbox_head.py
Class Name: ConvFCBBoxHead
Method Name: init_weights