058c2e6963c597d8c613d85646e200c38c059971,allennlp/modules/conditional_random_field.py,ConditionalRandomField,viterbi_tags,#ConditionalRandomField#Any#Any#Any#,333
Before Change
// At timestep 0 we must have the START_TAG
tag_sequence[0, start_tag] = 0.0
// At steps 1, ..., sequence_length we just use the incoming prediction
tag_sequence[1 : (sequence_length + 1), :num_tags] = prediction[:sequence_length]
// And at the last timestep we must have the END_TAG
tag_sequence[sequence_length + 1, end_tag] = 0.0
// We pass the tags and the transitions to ``viterbi_decode``.
After Change
tag sequences (the top tag sequence for each batch item).
if mask is None:
mask = torch.ones(*logits.shape[:2], dtype=torch.long, device=logits.device)
if top_k is None:
top_k = 1
flatten_output = True
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances Project Name: allenai/allennlp
Commit Name: 058c2e6963c597d8c613d85646e200c38c059971
Time: 2019-12-16
Author: eladsegal@users.noreply.github.com
File Name: allennlp/modules/conditional_random_field.py
Class Name: ConditionalRandomField
Method Name: viterbi_tags
Project Name: OpenNMT/OpenNMT-py
Commit Name: 445493da60b46728e81708442a8edaac1a381de6
Time: 2019-02-01
Author: guillaumekln@users.noreply.github.com
File Name: onmt/decoders/transformer.py
Class Name: TransformerDecoderLayer
Method Name: forward
Project Name: microsoft/nni
Commit Name: 9d468d2c742491af2d2f506c648ddc95ffea6a64
Time: 2019-10-20
Author: lanny@mail.hfut.edu.cn
File Name: src/sdk/pynni/nni/compression/torch/builtin_pruners.py
Class Name: AGP_Pruner
Method Name: calc_mask