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


    //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)

def predict_word(text,learn,data,topk=5):
    
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 6

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: rusty1s/pytorch_geometric
Commit Name: 69dd0827d09eae0b4e6b95df854b2814175c9248
Time: 2019-04-10
Author: matthias.fey@tu-dortmund.de
File Name: torch_geometric/nn/models/signed_gcn.py
Class Name: SignedGCN
Method Name: create_spectral_features


Project Name: IBM/adversarial-robustness-toolbox
Commit Name: 86aca57545cfe312151cc35528035cd9c0aafe2d
Time: 2018-05-17
Author: M.N.Tran@ibm.com
File Name: art/classifiers/pytorch.py
Class Name: PyTorchClassifier
Method Name: predict


Project Name: AIRLab-POLIMI/mushroom
Commit Name: e304d4ee794a4cca8c116e52f99077ee71f87af1
Time: 2018-09-03
Author: carloderamo@gmail.com
File Name: mushroom/approximators/parametric/pytorch_network.py
Class Name: PyTorchApproximator
Method Name: predict