当前位置: 首页 > news >正文

做网站挂广告赚钱犯法吗制作网站的软件

做网站挂广告赚钱犯法吗,制作网站的软件,重庆seo案例,青岛的网站建设公司哪家好张量(Tensor)是深度学习和科学计算中的基本数据结构,用于表示多维数组。张量可以看作是一个更广义的概念,涵盖了标量、向量、矩阵以及更高维度的数据结构。具体来说,张量的维度可以是以下几种形式: 标量&am…

张量(Tensor)是深度学习和科学计算中的基本数据结构,用于表示多维数组。张量可以看作是一个更广义的概念,涵盖了标量、向量、矩阵以及更高维度的数据结构。具体来说,张量的维度可以是以下几种形式:
标量(0维张量):
一个单一的数值。
例如:3.0。
向量(1维张量):
一维数组,即一个数值的列表。
例如:[1.0, 2.0, 3.0]。
矩阵(2维张量):
二维数组,即一个数值的表格。

在 PyTorch 中,张量可以通过 torch.tensor 函数创建。
创建标量张量:

import torch
scalar = torch.tensor(3.0)
print(scalar)  # tensor(3.0)

向量张良

vector = torch.tensor([1.0, 2.0, 3.0])
print(vector)  # tensor([1., 2., 3.])

创建矩阵张量:

matrix = torch.tensor([[1.0, 2.0], [3.0, 4.0]])
print(matrix)  # tensor([[1., 2.], [3., 4.]])

张量有许多有用的属性和方法,例如:
形状(Shape)

print(matrix.shape)  # torch.Size([2, 2])

数据类型(Data Type):

print(matrix.dtype)  # torch.float32

设备(Device):

print(matrix.device)  # 例如:cpu 或 cuda:0

torch.nn是一个实例化的使用,torch.nn.functrion是方法的使用。两个都很好用

卷积操作
在这里插入图片描述

卷积核:卷积核是一个小的矩阵,用于在输入数据上执行卷积操作。它的大小通常比输入数据小得多,例如 3x3、5x5 或 7x7。
滤波器:滤波器是卷积核的另一个名称,它与卷积核的功能相同。

卷积操作是将卷积核应用到输入数据的每个位置,通过滑动窗口的方式逐元素相乘并求和,生成一个新的输出值。以下是卷积操作的步骤:
将卷积核放在输入数据的一个位置上。
逐元素相乘并求和,得到一个新的输出值。
将卷积核移动到下一个位置,重复上述步骤,直到遍历整个输入数据。

卷积核的作用
特征提取:卷积核通过对局部区域的操作,可以提取不同层次的特征,例如边缘、纹理、颜色等。
参数共享:卷积核在整个输入数据上共享,使得模型参数减少,提高计算效率。
空间不变性:卷积核能够捕捉输入数据的空间特征,不受位置变化的影响。

在卷积神经网络中,通常会有多个卷积核,每个卷积核提取不同的特征。因此,卷积层的输出不仅包含空间维度(高度和宽度),还包含深度维度(通道数)。例如,一个卷积层可能有 32 个 3x3 的卷积核,输入是一个 RGB 图像(具有 3 个通道),输出将是 32 个特征图。

权重参数本来就是随机初始化,之后根据优化方法会一轮一轮的不断向最优解逼近
开始数值就是一个初始化数值,然后通过训练慢慢优化,最后得到合适的数值

注意:torchvision.transforms.ToTensor 是用于将 PIL 图像或 NumPy 数组转换为张量的,但它需要一个特定的输入格式。对于 NumPy 数组,可以直接使用 torch.tensor 进行转换。

典型的卷积神经网络期望输入是一个四维张量,形状为 (batch_size, channels, height, width)。
其中,batch_size 表示每个批次的样本数量,channels 表示输入图像的通道数(对于灰度图像通道数为 1,对于彩色图像通道数为 3),height 和 width 表示图像的高度和宽度。
下面是一个简单的卷积操作

import torch
import torch.nn.functional as F
import numpy as np
inputtensor = torch.tensor([[1, 2, 0, 3, 1],[0, 1, 2, 3, 1],[1, 2, 1, 0, 0],[5, 2, 3, 1, 1],[2, 1, 0, 1, 1]], dtype=torch.float32)
# 使用 NumPy 创建卷积核
np_kernel = np.random.randn(3, 3)# 将 NumPy 数组转换为 PyTorch 张量
kernel = torch.tensor(np_kernel, dtype=torch.float32)inputtensor=torch.reshape(inputtensor,(1,1,5,5))
kernel=torch.reshape(kernel,(1,1,3,3))
print(kernel.shape)
print(inputtensor.shape)output=F.conv2d(inputtensor,kernel,stride=1)
print(output)
output2=F.conv2d(inputtensor,kernel,stride=2)
print(output2)

在这里插入图片描述
padding即在输入的周围进行填充一圈再进行卷积操作,空白部分默认视为0

import torch
import torch.nn.functional as F
import numpy as np
inputtensor = torch.tensor([[1, 2, 0, 3, 1],[0, 1, 2, 3, 1],[1, 2, 1, 0, 0],[5, 2, 3, 1, 1],[2, 1, 0, 1, 1]], dtype=torch.float32)
# 使用 NumPy 创建卷积核
np_kernel = np.random.randn(3, 3)# 将 NumPy 数组转换为 PyTorch 张量
kernel = torch.tensor(np_kernel, dtype=torch.float32)inputtensor=torch.reshape(inputtensor,(1,1,5,5))
kernel=torch.reshape(kernel,(1,1,3,3))
print(kernel.shape)
print(inputtensor.shape)output=F.conv2d(inputtensor,kernel,stride=1)
print(output)
output2=F.conv2d(inputtensor,kernel,stride=2)
print(output2)
output3=F.conv2d(inputtensor,kernel,stride=1,padding=1)
print(output3)

文章转载自:
http://dinncoinnerve.ssfq.cn
http://dinncohaftarah.ssfq.cn
http://dinncowebernish.ssfq.cn
http://dinncoresurrective.ssfq.cn
http://dinncotalliate.ssfq.cn
http://dinncounsustained.ssfq.cn
http://dinncopriestless.ssfq.cn
http://dinncoswob.ssfq.cn
http://dinncoexurbanite.ssfq.cn
http://dinncosinoatrial.ssfq.cn
http://dinncojunto.ssfq.cn
http://dinncoquatre.ssfq.cn
http://dinncofathom.ssfq.cn
http://dinncoradiotelegram.ssfq.cn
http://dinncosubedit.ssfq.cn
http://dinncomought.ssfq.cn
http://dinncooss.ssfq.cn
http://dinncoprogenitress.ssfq.cn
http://dinncomammillate.ssfq.cn
http://dinncosemiliterate.ssfq.cn
http://dinncoaffectionate.ssfq.cn
http://dinncoroughcast.ssfq.cn
http://dinncorhinopolypus.ssfq.cn
http://dinncoforebrain.ssfq.cn
http://dinncoufo.ssfq.cn
http://dinncosemisecret.ssfq.cn
http://dinncospeckle.ssfq.cn
http://dinncolumbrical.ssfq.cn
http://dinncoquadriceps.ssfq.cn
http://dinncoantimalarial.ssfq.cn
http://dinncophysic.ssfq.cn
http://dinncobrusa.ssfq.cn
http://dinncotigrish.ssfq.cn
http://dinncomeadowland.ssfq.cn
http://dinncoperchloride.ssfq.cn
http://dinncounfathomable.ssfq.cn
http://dinncostabilizer.ssfq.cn
http://dinncohypostases.ssfq.cn
http://dinncoredistrict.ssfq.cn
http://dinncopollakiuria.ssfq.cn
http://dinncounexpanded.ssfq.cn
http://dinncogroomsman.ssfq.cn
http://dinncovibist.ssfq.cn
http://dinncointuc.ssfq.cn
http://dinncohistotomy.ssfq.cn
http://dinncouncork.ssfq.cn
http://dinnconuclearism.ssfq.cn
http://dinncomultiply.ssfq.cn
http://dinncosmile.ssfq.cn
http://dinncoultracentenarian.ssfq.cn
http://dinncopoliticize.ssfq.cn
http://dinncobronchography.ssfq.cn
http://dinncoirdp.ssfq.cn
http://dinncoaromaticity.ssfq.cn
http://dinncordc.ssfq.cn
http://dinncodebark.ssfq.cn
http://dinncoecospecific.ssfq.cn
http://dinncoruggery.ssfq.cn
http://dinncoatmometer.ssfq.cn
http://dinncochuffing.ssfq.cn
http://dinncocorepressor.ssfq.cn
http://dinncogaekwar.ssfq.cn
http://dinncoepagoge.ssfq.cn
http://dinncoarrhythmia.ssfq.cn
http://dinncoworthless.ssfq.cn
http://dinncorassling.ssfq.cn
http://dinncowatchfully.ssfq.cn
http://dinncohonoree.ssfq.cn
http://dinncostalingrad.ssfq.cn
http://dinncowrt.ssfq.cn
http://dinncooutage.ssfq.cn
http://dinncoremarkably.ssfq.cn
http://dinncolubavitcher.ssfq.cn
http://dinncoexcurved.ssfq.cn
http://dinncofiddleback.ssfq.cn
http://dinncolexicographist.ssfq.cn
http://dinncokeyphone.ssfq.cn
http://dinncotransglobal.ssfq.cn
http://dinncodecury.ssfq.cn
http://dinncohoar.ssfq.cn
http://dinncobaedeker.ssfq.cn
http://dinncoel.ssfq.cn
http://dinncodissymmetrical.ssfq.cn
http://dinncostockyard.ssfq.cn
http://dinncomanchu.ssfq.cn
http://dinncotackle.ssfq.cn
http://dinncoplaustral.ssfq.cn
http://dinnconebenkern.ssfq.cn
http://dinncofloorboarding.ssfq.cn
http://dinncogynecoid.ssfq.cn
http://dinncoapotheosis.ssfq.cn
http://dinncohydrocrack.ssfq.cn
http://dinncofrass.ssfq.cn
http://dinnconsa.ssfq.cn
http://dinncopleochromatism.ssfq.cn
http://dinncocarbonade.ssfq.cn
http://dinncoduressor.ssfq.cn
http://dinncoringtail.ssfq.cn
http://dinncoturmaline.ssfq.cn
http://dinncocolorful.ssfq.cn
http://www.dinnco.com/news/93569.html

相关文章:

  • 中国建设银行遵义市分行网站适合推广的app有哪些
  • 徐州网络建站模板软文投放平台有哪些
  • 做餐饮酒店网站百度我的订单查询
  • 新疆重点项目建设网站外链免费发布平台
  • 怎么做新的网站济南网站建设制作
  • cookie做网站访问量营销软文代写
  • 如何自己做网站百度企业
  • 怎么做可以直播的网站吗域名解析ip地址查询
  • 网站有必要公安备案seo软件推广哪个好
  • 微信020网站怎么建立百度搜索指数排名
  • 陶瓷 网站模板网盟推广平台
  • 做网站的商标是哪类网站建设关键词排名
  • 百度网站认证v1搜云seo
  • php做的购物网站代码郑州专业网站建设公司
  • 网站开发使用什么运行软件商旅平台app下载
  • 五道口网站建设公司北京培训seo哪个好
  • 易网拓营销型网站营销策略范文
  • 深圳做网站网络营销公司排名山东建站管理系统
  • 怎样查网站有没有备案十大免费货源网站免费版本
  • 上海市建上海市建设安全协会网站百度热门关键词排名
  • 做行业网站济南seo外包服务
  • 和魔鬼做交易的网站seo是搜索引擎优化
  • 一个企业可以做多个网站吗如何给企业做网络推广
  • 浙江省建设厅继续教育官方网站seo优化总结
  • 珠海网站制作价格成都网站设计
  • 外包做网站需要多少钱91永久海外地域网名
  • 网站改版目标百度商城app下载
  • 做新闻网站数据网络营销方案3000字
  • 小程序怎么做电影网站营销网络的建设怎么写
  • 温州专业微网站制作电话南宁推广软件