9aa5a88cbc1a36f19305f229b3a9abbeb9add631,pythainlp/ulmfit/__init__.py,,document_vector,#Any#Any#Any#,84

Before Change


    m = learn.model[0]
    m.reset()
    pred,_ = m(t)
    res = pred[-1][-1,:,:].squeeze().detach().numpy()
    return(res)

After Change


    pred,_ = m(t)
    //return concatenation of last, mean and max
    last = pred[-1][-1,:,:].squeeze()
    avg_pool = pred[-1].mean(0)[0].squeeze()
    max_pool = pred[-1].max(0)[0].squeeze()
    res = torch.cat((last,avg_pool,max_pool)).detach().cpu().numpy()
    return(res)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: PyThaiNLP/pythainlp
Commit Name: 9aa5a88cbc1a36f19305f229b3a9abbeb9add631
Time: 2018-11-21
Author: ubuntu@ip-172-31-38-199.us-west-2.compute.internal
File Name: pythainlp/ulmfit/__init__.py
Class Name:
Method Name: document_vector


Project Name: PacktPublishing/Deep-Reinforcement-Learning-Hands-On
Commit Name: 8d52bd0b09152b02e0a5504d33593d0c290b88c7
Time: 2018-02-05
Author: max.lapan@gmail.com
File Name: ch14/06_train_d4pg.py
Class Name:
Method Name:


Project Name: interactiveaudiolab/nussl
Commit Name: 5c049ebd9c8a00affe115501a5a89eed3ae7978a
Time: 2020-04-15
Author: prem@u.northwestern.edu
File Name: nussl/ml/train/loss.py
Class Name: SISDRLoss
Method Name: forward