上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 72 下一页

2020年8月30日

机器学习基础概述

摘要: 实用特征:可观察且可量化 L2损失:平方误差 均方误差 (MSE) :指的是每个样本的平均平方损失。要计算 MSE,请求出各个样本的所有平方损失之和,然后除以样本数量 虽然 MSE 常用于机器学习,但它既不是唯一实用的损失函数,也不是适用于所有情形的最佳损失函数。 阅读全文

posted @ 2020-08-30 21:59 cltt 阅读(100) 评论(0) 推荐(0) 编辑

2020年8月29日

nn.Linear nn.Conv2d nn.BatchNorm2d

摘要: conv,BN,Linear conv:https://blog.csdn.net/Strive_For_Future/article/details/83240232 1)conv2d.weight shape=[输出channels,输入channels,kernel_size,kernel_s 阅读全文

posted @ 2020-08-29 18:10 cltt 阅读(528) 评论(0) 推荐(0) 编辑

pytorch 中tensor在CPU和GPU之间转换

摘要: 1. CPU tensor转GPU tensor: cpu_imgs.cuda()2. GPU tensor 转CPU tensor: gpu_imgs.cpu()3. numpy转为CPU tensor: torch.from_numpy( imgs )4.CPU tensor转为numpy数据: 阅读全文

posted @ 2020-08-29 10:07 cltt 阅读(2849) 评论(0) 推荐(0) 编辑

2020年8月28日

pytorch tensor 的拼接和拆分

摘要: torch.catimport torch a=torch.randn(3,4) #随机生成一个shape(3,4)的tensort b=torch.randn(2,4) #随机生成一个shape(2,4)的tensor print("a:") print(a) print("b:") print( 阅读全文

posted @ 2020-08-28 21:17 cltt 阅读(1869) 评论(0) 推荐(0) 编辑

计算模型的Para和GFLOPs

摘要: import torch.nn as nn import torch import torch.nn.functional as F class FP_Conv2d(nn.Module): def __init__(self, input_channels, output_channels, ker 阅读全文

posted @ 2020-08-28 15:49 cltt 阅读(838) 评论(0) 推荐(0) 编辑

2020年8月27日

B bit

摘要: 1B(byte)=8bit B:字节 bit:位(计算机表示数据最小的单位) B与bit 数据存储是以“字节”(Byte)为单位,数据传输大多是以“位”(bit,又名“比特”)为单位,一个位就代表一个0或1(即二进制),每8个位(bit,简写为b)组成一个字节(Byte,简写为B),是最小一级的信息 阅读全文

posted @ 2020-08-27 21:47 cltt 阅读(470) 评论(0) 推荐(0) 编辑

2020年8月25日

torch.nn.Sequential()搭建神经网络模型

摘要: 一、第一种方式(可以配合一些条件判断语句动态添加) 模板——torch.nn.Sequential()的一个对象.add_module(name, module)。 name:某层次的名字;module:需要添加的子模块,如卷积、激活函数等等。 添加子模块到当前模块中。 可以通过 name 属性来访 阅读全文

posted @ 2020-08-25 10:40 cltt 阅读(1850) 评论(0) 推荐(0) 编辑

2020年8月24日

self参数 - __ init__ ()方法 super(Net, self).__init__()

摘要: self参数 self指的是实例Instance本身,在Python类中规定,函数的第一个参数是实例对象本身,并且约定俗成,把其名字写为self, 也就是说,类中的方法的第一个参数一定要是self,而且不能省略。关于self有三点是很重要的: self指的是实例本身,而不是类 self可以用this 阅读全文

posted @ 2020-08-24 11:17 cltt 阅读(4045) 评论(0) 推荐(1) 编辑

2020年8月22日

PyTorch 两大转置函数 transpose() 和 permute(),

摘要: 在pytorch中转置用的函数就只有这两个 transpose() permute() transpose() torch.transpose(input, dim0, dim1, out=None) → Tensor 函数返回输入矩阵input的转置。交换维度dim0和dim1 参数: input 阅读全文

posted @ 2020-08-22 23:03 cltt 阅读(14621) 评论(0) 推荐(1) 编辑

nn.Conv2d卷积

摘要: 二维卷积可以处理二维数据 nn.Conv2d(self, in_channels, out_channels, kernel_size, stride=1, padding=0, dilation=1, groups=1, bias=True))参数: in_channel: 输入数据的通道数,例R 阅读全文

posted @ 2020-08-22 21:59 cltt 阅读(212) 评论(0) 推荐(0) 编辑

上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 72 下一页

导航