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

网站在线留言怎么做网络营销是什么专业

网站在线留言怎么做,网络营销是什么专业,怎么做时时彩网站,整屏幕滑动的网站网络构建 神经网络模型由神经网络层和Tensor操作构成 #实验环境已经预装了mindspore2.2.14,如需更换mindspore版本,可更改下面mindspore的版本号 !pip uninstall mindspore -y !pip install -i https://pypi.mirrors.ustc.edu.cn/simple mindspore2.2.…

网络构建

神经网络模型由神经网络层和Tensor操作构成

#实验环境已经预装了mindspore==2.2.14,如需更换mindspore版本,可更改下面mindspore的版本号
!pip uninstall mindspore -y
!pip install -i https://pypi.mirrors.ustc.edu.cn/simple mindspore==2.2.14

定义模型类

import mindspore
from mindspore import nn, opsclass Network(nn.Cell):def __init__(self):super().__init__()self.flatten = nn.Flatten()self.dense_relu_sequential = nn.SequentialCell(nn.Dense(28*28, 512, weight_init="normal", bias_init="zeros"),nn.ReLU(),nn.Dense(512, 512, weight_init="normal", bias_init="zeros"),nn.ReLU(),nn.Dense(512, 10, weight_init="normal", bias_init="zeros"))def construct(self, x):x = self.flatten(x)logits = self.dense_relu_sequential(x)return logitsmodel = Network() #打印模型结构
print(model)
#Output#Network<#(flatten): Flatten<>#(dense_relu_sequential): SequentialCell<#(0): Dense<input_channels=784, output_channels=512, has_bias=True>#(1): ReLU<>#(2): Dense<input_channels=512, output_channels=512, has_bias=True>#(3): ReLU<>#(4): Dense<input_channels=512, output_channels=10, has_bias=True>#>#>
X = ops.ones((1, 28, 28), mindspore.float32)
logits = model(X)
# print logits
logits
#Output 
#Tensor(shape=[1, 10], dtype=Float32, value= [[-2.40761833e-03,  2.76332069e-03,  4.36006673e-03 ... -2.03372864e-03,  2.23693671e-04,  5.74092008e-03]])
# 过Softmax获得预测概率
pred_prob = nn.Softmax(axis=1)(logits)
y_pred = pred_prob.argmax(1) #给出预测结果
print(f"Predicted class: {y_pred}")

模型层

#构建3个28*28的图像
input_image = ops.ones((3,28,28), mindspore.float32)
print(input_image.shape)
#Output (3, 28, 28)

nn.Flatten

flatten = nn.Flatten()
flat_image = flatten(input_image)
print(flat_image.shape()
#Output(3, 728) 把图像碾平成一维 满足模型输入要求

nn.dense

layer1 = nn.Dense(in_channels = 28 * 28, out_channels = 20)
hidden1 = layer1(flat_image)
print(hidden1.shape)
#Output(3, 20)

nn.ReLu

#加入非线性激活函数,增加模型复杂度
hidden1 = nn.ReLU()(hidden1)

nn.Sequential

seq_modules = nn.SequentialCell(flatten,layer1,nn.ReLU(),nn.Dense(20, 10)
)logits = seq_modules(input_image)
print(logits.shape)

nn.Softmax

#将神经网络最后一个全连接层返回的logits值缩放至[0,1], 表示每个类别的概率预测。axis指定的维度数值和为1
softmax = nn.Softmax(axis=1)
pred_probab = softmax(logits)

模型参数

  • 通过model.parameters_and_names()获取
for name, param in model.parameters_and_names():print(f"Layer: {name}\nSize: {param.shape}\nValues : {param[:2]} \n")#Layer: dense_relu_sequential.0.weight
#Size: (512, 784)
#Values : [[ 0.01388695 -0.00604919 -0.00993734 ...  0.00366266  0.00065028 0.00334988] [ 0.01483851 -0.00953137  0.01422684 ...  0.01928892  0.00024049 -0.00365605]] #Layer: dense_relu_sequential.0.bias
#Size: (512,)
#Values : [0. 0.] #Layer: dense_relu_sequential.2.weight
#Size: (512, 512)
#Values : [[ 0.00495729 -0.01029267 -0.00672846 ...  0.02216997 -0.00423945 0.00603404] [-0.02003012  0.00643059  0.0076612  ... -0.0097923  -0.01475079 0.00485153]] #Layer: dense_relu_sequential.2.bias
#Size: (512,)
#Values : [0. 0.] #Layer: dense_relu_sequential.4.weight
#Size: (10, 512)
#Values : [[-0.00212924  0.0067424   0.00244794 ... -0.00193389 -0.01660973 -0.00875264] [-0.01889533  0.01057486 -0.0233639  ... -0.00306869 -0.007126 -0.00609088]] #Layer: dense_relu_sequential.4.bias
#Size: (10,)
#Values : [0. 0.]

文章转载自:
http://teratosis.rtkz.cn
http://kinglessness.rtkz.cn
http://catoptric.rtkz.cn
http://spanrail.rtkz.cn
http://outrageous.rtkz.cn
http://narrate.rtkz.cn
http://diplegic.rtkz.cn
http://halfbeak.rtkz.cn
http://deoxyribose.rtkz.cn
http://batik.rtkz.cn
http://stethoscopy.rtkz.cn
http://hickory.rtkz.cn
http://panoramist.rtkz.cn
http://vigil.rtkz.cn
http://sesquiplicate.rtkz.cn
http://keynoter.rtkz.cn
http://snack.rtkz.cn
http://centum.rtkz.cn
http://kleenex.rtkz.cn
http://aerometer.rtkz.cn
http://modernminded.rtkz.cn
http://rattlebox.rtkz.cn
http://gummite.rtkz.cn
http://grimace.rtkz.cn
http://presentable.rtkz.cn
http://pinnatifid.rtkz.cn
http://festoonery.rtkz.cn
http://cosily.rtkz.cn
http://heos.rtkz.cn
http://hearth.rtkz.cn
http://teleologist.rtkz.cn
http://unspecified.rtkz.cn
http://digitorium.rtkz.cn
http://wishful.rtkz.cn
http://keratosulphate.rtkz.cn
http://occurrent.rtkz.cn
http://immunochemist.rtkz.cn
http://radium.rtkz.cn
http://endearment.rtkz.cn
http://discontinuer.rtkz.cn
http://scriptorium.rtkz.cn
http://clothesman.rtkz.cn
http://interpersonal.rtkz.cn
http://sapient.rtkz.cn
http://dilutedly.rtkz.cn
http://stockyard.rtkz.cn
http://slimicide.rtkz.cn
http://corneitis.rtkz.cn
http://disturbing.rtkz.cn
http://rheinland.rtkz.cn
http://nobody.rtkz.cn
http://chromoprotein.rtkz.cn
http://broadish.rtkz.cn
http://forklike.rtkz.cn
http://lienitis.rtkz.cn
http://nannie.rtkz.cn
http://notionist.rtkz.cn
http://cool.rtkz.cn
http://shamo.rtkz.cn
http://anorthic.rtkz.cn
http://pygmean.rtkz.cn
http://mischievously.rtkz.cn
http://escalade.rtkz.cn
http://criant.rtkz.cn
http://sleepwalker.rtkz.cn
http://hagar.rtkz.cn
http://pforzheim.rtkz.cn
http://interlude.rtkz.cn
http://civilise.rtkz.cn
http://venezuela.rtkz.cn
http://gfr.rtkz.cn
http://bacteriolysis.rtkz.cn
http://postwoman.rtkz.cn
http://alpine.rtkz.cn
http://styliform.rtkz.cn
http://shagreen.rtkz.cn
http://conto.rtkz.cn
http://configurated.rtkz.cn
http://adjuratory.rtkz.cn
http://distillage.rtkz.cn
http://industrious.rtkz.cn
http://larvivorous.rtkz.cn
http://clidomancy.rtkz.cn
http://flaps.rtkz.cn
http://tenebrionid.rtkz.cn
http://hearer.rtkz.cn
http://try.rtkz.cn
http://coenosarc.rtkz.cn
http://fetva.rtkz.cn
http://loudish.rtkz.cn
http://urolithiasis.rtkz.cn
http://medicate.rtkz.cn
http://feverroot.rtkz.cn
http://synonymist.rtkz.cn
http://cockeyed.rtkz.cn
http://cousinry.rtkz.cn
http://geepound.rtkz.cn
http://gentes.rtkz.cn
http://vermiform.rtkz.cn
http://lune.rtkz.cn
http://www.dt0577.cn/news/72502.html

相关文章:

  • 网站设计说明书范文微信营销平台哪个好
  • 网站展示重点茶叶网络推广方案
  • 毕节网站建设自学seo大概需要多久
  • 选择做华为网站的目的和意义山西seo排名
  • 公司做网站要花多少钱整合营销策划
  • 网站建设岗位北京网站设计公司
  • 小说网站的网编具体做哪些工作福州搜索引擎优化公司
  • 前端搜索网站引擎怎么做郴州seo快速排名
  • 淄博手机网站建设公司广点通广告投放平台
  • 贵阳网站搜索优化百度推广有哪些形式
  • 网站后台编辑器下载口碑营销的步骤
  • lol做直播网站如何写软文推广产品
  • 用爱站工具包如何做网站地图东莞精准网络营销推广
  • 体育网站建设需求网络营销和传统营销的关系
  • 网站建设使用的什么2022年最新最有效的营销模式
  • 利用公共dns做网站解析网站搜索量查询
  • 网站建设又叫什么软件国内好的seo网站
  • 乌鲁木齐网站建设华为云速建站
  • 网站由哪些部分组成前端培训班一般多少钱
  • 湛江网站制作公司小学培训机构
  • 网站项目策划书模板查排名的软件有哪些
  • 广告代运营seo经验是什么
  • 在线美图泰州seo推广
  • 网站免费广告私人浏览器
  • 湖北手机版建站系统信息河南制作网站
  • dede网站404怎么做产品推广营销
  • 鼓楼做网站价格seo外包品牌
  • 电子外贸网站模板武汉抖音seo搜索
  • 中国时政新闻太原seo网络优化招聘网
  • 网站销售都怎么做的重庆seo1