code stringlengths 3 6.57k |
|---|
enumerate(lengths, start=startIdx) |
start_idxs.append(i) |
end_idxs.append(i-1) |
end_idxs.append(startIdx + len(lengths) |
zip(start_idxs, end_idxs) |
find_unique_tags(train_data_tags, null_label=False) |
Tags() |
unfreeze_dict(tags) |
items() |
unique_tags.tagExists(tag) |
unique_tags.addTag(tag) |
unique_tags.getTagbyName(tag) |
curTag.labelExists(label) |
curTag.addLabel(label) |
tag.addLabel("NULL") |
plot_heatmap(uniqueTags, weights, kind) |
matplotlib.rc('font', **font) |
list(itertools.combinations(range(uniqueTags.size() |
enumerate(weights) |
uniqueTags.getTagbyIdx(i) |
uniqueTags.getTagbyIdx(j) |
plt.figure(figsize=(20, 18) |
plt.xticks(range(0, len(tag2_labels) |
plt.yticks(range(0, len(tag1_labels) |
plt.tick_params(labelsize=25) |
plt.xlabel(tag2.name, fontsize=40) |
plt.ylabel(tag1.name, fontsize=50) |
plt.imshow(weight.data.cpu() |
numpy() |
plt.savefig("figures/" + tag1.name + "_" + tag2.name + ".png", bbox_inches='tight') |
plt.close() |
uniqueTags.getTagbyIdx(k) |
plt.figure(figsize=(20, 18) |
plt.xticks(range(0, len(tag_labels) |
plt.yticks(range(0, len(tag_labels) |
plt.tick_params(labelsize=40) |
plt.xlabel(tag.name, fontsize=50) |
plt.ylabel(tag.name, fontsize=50) |
plt.imshow(weight.data.cpu() |
numpy() |
plt.savefig("figures/" + tag.name + "_" + tag.name + ".png", bbox_inches='tight') |
plt.close() |
get_var(x, gpu=False, volatile=False) |
Variable(x, volatile=volatile) |
x.cuda() |
prepare_sequence(seq, to_ix, gpu=False) |
isinstance(to_ix, dict) |
isinstance(to_ix, list) |
to_ix.index(w) |
to_ix.index("UNK") |
torch.LongTensor(idxs) |
get_var(tensor, gpu) |
to_scalar(var) |
var.view(-1) |
data.tolist() |
argmax(vec) |
torch.max(vec, 1) |
to_scalar(idx) |
logSumExp(a, b) |
np.maximum(a, b) |
np.exp(aexp) |
np.exp(bexp) |
np.log(sumOfExp) |
logSumExpTensor(vec) |
vec.size() |
vec.view(batch_size, -1) |
torch.max(vec, 1) |
max_score.view(-1, 1) |
expand(-1, vec.size() |
torch.log(torch.sum(torch.exp(vec - max_score_broadcast) |
logSumExpTensors(a, b) |
torch.max(a, b) |
torch.exp(aexp) |
torch.exp(bexp) |
torch.log(sumOfExp) |
logDot(a, b, redAxis=None) |
b.transpose() |
np.amax(a) |
np.amax(b) |
np.dot(np.exp(a - max_a) |
np.exp(b - max_b) |
np.log(C, out=C) |
np.log(C + 1e-300, out=C) |
C.transpose() |
logMax(a, b, redAxis=None) |
b.transpose() |
np.amax(a) |
np.amax(b) |
np.max(np.exp(a[:, :, None]-max_a) |
np.exp(b[None, :, :]-max_b) |
np.isfinite(C) |
all() |
np.log(C, out=C) |
np.log(C + 1e-300, out=C) |
C.transpose() |
logNormalize(a) |
np.logaddexp.reduce(a, 1) |
return (a.transpose() |
transpose() |
logNormalizeTensor(a) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.