12 2020 档案

摘要:x = 50000011 s = '${:1.1f}M'.format(x*1e-6) print(s) s = '${:1.0f}K'.format(x * 1e-3) print(s) s = '${:.3f}K'.format(x * 1e-3) print(s) s = '%.3f' % ( 阅读全文
posted @ 2020-12-31 14:25 说分手后还能做炮友? 阅读(1709) 评论(0) 推荐(0)
摘要:import torch.nn as nn import torch # input = torch.randn(20, 5, 10, 10) # # With Learnable Parameters # m = nn.LayerNorm(input.size()[1:]) # # Without 阅读全文
posted @ 2020-12-25 13:48 说分手后还能做炮友? 阅读(906) 评论(0) 推荐(0)
摘要:import tensorflow as tf print(tf.eye(2)) batch_identity = tf.eye(2, batch_shape=[3]) print(batch_identity) print(tf.eye(2, num_columns=3)) E:\新脚本主文件夹\ 阅读全文
posted @ 2020-12-22 15:06 说分手后还能做炮友? 阅读(486) 评论(0) 推荐(0)
摘要:from transformers import pipeline from transformers import AutoTokenizer tokenizer = AutoTokenizer.from_pretrained('bert-base-cased') # encoded_input 阅读全文
posted @ 2020-12-16 10:17 说分手后还能做炮友? 阅读(152) 评论(0) 推荐(0)
摘要:如上 阅读全文
posted @ 2020-12-10 10:57 说分手后还能做炮友? 阅读(158) 评论(0) 推荐(0)
摘要:Xavier在tanh中表现的很好,但在Relu激活函数中表现的很差,所何凯明提出了针对于relu的初始化方法。pytorch默认使用kaiming正态分布初始化卷积层参数。 (1)kaiming均匀分布 U(−bound,bound) (2)kaiming正态分布 N(0,std) 阅读全文
posted @ 2020-12-09 13:24 说分手后还能做炮友? 阅读(479) 评论(0) 推荐(0)
摘要:import numpy as np lis = [1, 5, -9, 3, -6, 8, -7, 5, 5, 5, 4, 4, 4, 6, 6, 6, 6] lis = np.array(lis) lis[lis <= 0] = 100 print(lis) [ 1 5 100 3 100 8 1 阅读全文
posted @ 2020-12-07 14:49 说分手后还能做炮友? 阅读(134) 评论(0) 推荐(0)
摘要:import torch import torchvision import torch.nn as nn import torch.nn.functional as F x = torch.randn(3, 4) print(x) print() sorted, indices = torch.s 阅读全文
posted @ 2020-12-07 14:02 说分手后还能做炮友? 阅读(258) 评论(0) 推荐(0)
摘要:import torch import torchvision import torch.nn as nn import torch.nn.functional as F # x = torch.randn(2, 3) x = torch.randn(2, 3,4) print(x) print() 阅读全文
posted @ 2020-12-04 17:17 说分手后还能做炮友? 阅读(268) 评论(0) 推荐(0)
摘要:hardsigmoid torch.nn.functional.hardsigmoid(input) → Tensor[SOURCE] Applies the element-wise function \text{Hardsigmoid}(x) = \begin{cases} 0 & \text{ 阅读全文
posted @ 2020-12-01 09:59 说分手后还能做炮友? 阅读(597) 评论(0) 推荐(0)