自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(6)
  • 收藏
  • 关注

原创 pytorch 查看tensor的数据类型

import torchx=torch.Tensor([1,2])print('x: ',x)print('type(x): ',type(x))print('x.dtype: ',x.dtype) # x的具体类型y=x.int()print('y: ',y)print('type(y): ',type(y))print('y.dtype: ',y.d...

2019-02-22 14:58:15 36617

原创 torch.nn.Linear()函数的理解

import torchx = torch.randn(128, 20) # 输入的维度是(128,20)m = torch.nn.Linear(20, 30) # 20,30是指维度output = m(x)print('m.weight.shape:\n ', m.weight.shape)print('m.bias.shape:\n', m.bias.shape)print...

2019-02-21 15:10:19 146956 19

原创 torch.nn 和torch.nn.functional的区别浅析

举例:拿maxpool操作来说import torchx_input = torch.randn(20, 16, 50)# 先定义一个model,再把数据传进去# pool of size=3, stride=2m = torch.nn.MaxPool1d(3, stride=2)x_output = m(x_input)print(x_output.shape) # torc...

2019-02-21 10:47:51 1238

原创 torch.nn.Conv2d()函数详解

import torchx = torch.randn(2,1,7,3)conv = torch.nn.conv2d(1,8,(2,3))res = conv(x)print(res.shape) # shape = (2, 8, 6, 1)输入:x[ batch_size, channels, height_1, width_1 ]batch_size ...

2019-02-21 09:52:02 56076 14

原创 logging模块,记录函数运行时间

import loggingimport timedef log(func): def wrapper(*args, **kwatgs): start_time = time.time() logging.info('start %s()' % func.__name__) ret = func(*args, **kwatgs) ...

2019-02-16 09:42:53 1950

转载 【转】chrome浏览器无法离线添加扩展程序crx插件文件

chrome浏览器无法离线添加扩展程序crx插件文件

2019-02-13 14:54:29 403

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除