3218a3987ef9f83d1ad5efd6f96d6f6c741c3cfa,python/eight_mile/pytorch/layers.py,,viterbi,#Any#Any#Any#Any#Any#Any#,776
Before Change
best_path.reverse()
best_path = torch.stack(best_path)
// Return list of paths
paths = []
best_path = best_path.transpose(0, 1)
for path, length in zip(best_path, lengths):
paths.append(path[:length])
return paths, path_score.squeeze(0)
class TaggerGreedyDecoder(nn.Module):
After Change
best_path = torch.stack(best_path)
// Mask out the extra tags (This might be pointless given that anything that
// will use this as a dense tensor downstream will mask it itself?)
seq_mask = sequence_mask(lengths).to(best_path.device).transpose(0, 1)
best_path = best_path.masked_fill(seq_mask == 0, 0)
return best_path, path_score
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 8
Instances Project Name: dpressel/mead-baseline
Commit Name: 3218a3987ef9f83d1ad5efd6f96d6f6c741c3cfa
Time: 2019-09-27
Author: dpressel@gmail.com
File Name: python/eight_mile/pytorch/layers.py
Class Name:
Method Name: viterbi
Project Name: tensorflow/models
Commit Name: 90f63a1e1653bfa17fde8260a4aa20231b269b7d
Time: 2017-06-29
Author: alexleegk@gmail.com
File Name: video_prediction/prediction_model.py
Class Name:
Method Name: cdna_transformation
Project Name: dpressel/mead-baseline
Commit Name: 9b72ec0d4963412e9790b06d22f051a9723af33c
Time: 2019-02-24
Author: blester125@users.noreply.github.com
File Name: python/baseline/pytorch/crf.py
Class Name:
Method Name: viterbi