摘要:
在实际应用中,我们经常需要解决这样一类问题:如何计算一个句子的概率?如: 机器翻译:P(high winds tonite) > P(large winds tonite) 拼写纠错:P(about fifteen minutes from) > P(about fifteenminuets fro 阅读全文
摘要:
th> a=torch.range(1,5) [0.0001s] th> a 1 2 3 4 5 [torch.DoubleTensor of size 5] ... 阅读全文
摘要:
如果A为向量 norm(A,p) 返回向量A的p范数。 norm(A) 返回向量A的2范数,即等价于norm(A,2)。 阅读全文
摘要:
#里面:>>> a=['0'*5] >>> a ['00000'] >>> a=['0,'*5] >>> a ['0,0,0,0,0,'] #外面: >>> a=['0']*5 >>> a ['0', '0', '0', '0', '0'] #对于字符串,里面和外面产生结果不同,里面是增加字符串的个数,外面是增加列表元素。 > 阅读全文
摘要:
print(数量 * '字符或字符串') #输出空格 print(10 * ' ') #重复输出字符 print(10 * 'a') #重复输出字符串 print(10 * 'abc') 阅读全文