深度学习之反向传播算法

反向传播算法

  • 数学公式
    • 算法代码
      • 结果
  • 算法中一些函数的区别

数学公式

在这里插入图片描述
在这里插入图片描述

算法代码

这里用反向传播算法,计算 y = w * x模型

import numpy as np
import matplotlib.pyplot as ply#反向传播算法,需要使用pytorch框架,
#这里导入pytorch框架,用torchimport torch#用反向传播算法计算 y = w * x模型
x_data = [1.0, 2.0, 3.0, 4.0]
y_data = [2.0, 4.0, 6.0, 8.0]w = torch.Tensor(1)  # 设置初始值
w.requires_grad = True #计算梯度,默认是不计算的def forward(x):return w*xdef loss(x, y):y_pred = forward(x)return (y_pred - y)**2print('Predict (befortraining)',4,forward(4))#注意:在pytorch中,只有浮点类型的数才有梯度,因此在定义张量时一定要将类型指定为float型
#100轮
for epoch in range(100):l = loss(1, 2)  # 为了在for循环之前定义l,以便之后的输出,无实际意义for x, y in zip(x_data, y_data):l = loss(x, y)l.backward()  #计算梯度的函数(作用单独查下)print('\tgrad:', x, y, w.grad.item())w.data  = w.data - 0.01 * w.grad.data # w.grad是一个张量,所以要取dataw.grad.data.zero_() #释放之前的梯度print('Epoch:', epoch, l.item())print('Predict(after training)', 4, forward(4).item())

结果

“C:\Program Files\Python38\python.exe” C:\Users\惊艳了时光\Desktop\code\机器学习\反向传播算法.py
Predict (befortraining) 4 tensor([0.], grad_fn=)
grad: 1.0 2.0 -4.0
Epoch: 0 4.0
grad: 2.0 4.0 -15.680000305175781
Epoch: 0 15.366400718688965
grad: 3.0 6.0 -32.457603454589844
Epoch: 0 29.263774871826172
grad: 4.0 8.0 -47.31596755981445
Epoch: 0 34.98126220703125
grad: 1.0 2.0 -2.0109286308288574
Epoch: 1 1.0109584331512451
grad: 2.0 4.0 -7.882840156555176
Epoch: 1 3.883697986602783
grad: 3.0 6.0 -16.31747817993164
Epoch: 1 7.396113872528076
grad: 4.0 8.0 -23.78725814819336
Epoch: 1 8.841151237487793
grad: 1.0 2.0 -1.0109584331512451
Epoch: 2 0.25550922751426697
grad: 2.0 4.0 -3.9629573822021484
Epoch: 2 0.981564462184906
grad: 3.0 6.0 -8.203322410583496
Epoch: 2 1.8692916631698608
grad: 4.0 8.0 -11.9586181640625
Epoch: 2 2.234508514404297
grad: 1.0 2.0 -0.5082411766052246
Epoch: 3 0.06457727402448654
grad: 2.0 4.0 -1.9923057556152344
Epoch: 3 0.24808013439178467
grad: 3.0 6.0 -4.124073028564453
Epoch: 3 0.4724438488483429
grad: 4.0 8.0 -6.011981964111328
Epoch: 3 0.5647488832473755
grad: 1.0 2.0 -0.2555091381072998
Epoch: 4 0.016321230679750443
grad: 2.0 4.0 -1.0015954971313477
Epoch: 4 0.06269959360361099
grad: 3.0 6.0 -2.07330322265625
Epoch: 4 0.11940517276525497
grad: 4.0 8.0 -3.0224151611328125
Epoch: 4 0.14273427426815033
grad: 1.0 2.0 -0.12845253944396973
Epoch: 5 0.0041250139474868774
grad: 2.0 4.0 -0.5035343170166016
Epoch: 5 0.015846675261855125
grad: 3.0 6.0 -1.0423164367675781
Epoch: 5 0.030178431421518326
grad: 4.0 8.0 -1.5194625854492188
Epoch: 5 0.036074478179216385
grad: 1.0 2.0 -0.06457710266113281
Epoch: 6 0.001042550546117127
grad: 2.0 4.0 -0.2531423568725586
Epoch: 6 0.004005065653473139
grad: 3.0 6.0 -0.5240049362182617
Epoch: 6 0.007627254817634821
grad: 4.0 8.0 -0.7638816833496094
Epoch: 6 0.009117425419390202
grad: 1.0 2.0 -0.03246498107910156
Epoch: 7 0.0002634937409311533
grad: 2.0 4.0 -0.12726306915283203
Epoch: 7 0.0010122430976480246
grad: 3.0 6.0 -0.26343441009521484
Epoch: 7 0.0019277135143056512
grad: 4.0 8.0 -0.3840293884277344
Epoch: 7 0.0023043525870889425
grad: 1.0 2.0 -0.016321182250976562
Epoch: 8 6.659524660790339e-05
grad: 2.0 4.0 -0.0639791488647461
Epoch: 8 0.0002558332053013146
grad: 3.0 6.0 -0.13243675231933594
Epoch: 8 0.00048720816266722977
grad: 4.0 8.0 -0.19306182861328125
Epoch: 8 0.0005823886021971703
grad: 1.0 2.0 -0.008205175399780273
Epoch: 9 1.6831225366331637e-05
grad: 2.0 4.0 -0.032164573669433594
Epoch: 9 6.465998740168288e-05
grad: 3.0 6.0 -0.06658172607421875
Epoch: 9 0.00012314239575061947
grad: 4.0 8.0 -0.0970611572265625
Epoch: 9 0.00014720106264576316
grad: 1.0 2.0 -0.004125118255615234
Epoch: 10 4.2541500988591e-06
grad: 2.0 4.0 -0.016170501708984375
Epoch: 10 1.634281943552196e-05
grad: 3.0 6.0 -0.033473968505859375
Epoch: 10 3.112518243142404e-05
grad: 4.0 8.0 -0.048797607421875
Epoch: 10 3.7206351407803595e-05
grad: 1.0 2.0 -0.002074003219604492
Epoch: 11 1.0753723245215951e-06
grad: 2.0 4.0 -0.008130073547363281
Epoch: 11 4.131130936002592e-06
grad: 3.0 6.0 -0.016828536987304688
Epoch: 11 7.866657142585609e-06
grad: 4.0 8.0 -0.024532318115234375
Epoch: 11 9.403665899299085e-06
grad: 1.0 2.0 -0.0010426044464111328
Epoch: 12 2.7175599370821146e-07
grad: 2.0 4.0 -0.0040874481201171875
Epoch: 12 1.0442020084155956e-06
grad: 3.0 6.0 -0.008460044860839844
Epoch: 12 1.988121084650629e-06
grad: 4.0 8.0 -0.012332916259765625
Epoch: 12 2.3765753667248646e-06
grad: 1.0 2.0 -0.0005240440368652344
Epoch: 13 6.865553814350278e-08
grad: 2.0 4.0 -0.0020542144775390625
Epoch: 13 2.637373199831927e-07
grad: 3.0 6.0 -0.0042514801025390625
Epoch: 13 5.020856406190433e-07
grad: 4.0 8.0 -0.006198883056640625
Epoch: 13 6.004086117172847e-07
grad: 1.0 2.0 -0.00026345252990722656
Epoch: 14 1.7351808878629527e-08
grad: 2.0 4.0 -0.0010328292846679688
Epoch: 14 6.667102070423425e-08
grad: 3.0 6.0 -0.0021371841430664062
Epoch: 14 1.2687655726040248e-07
grad: 4.0 8.0 -0.003116607666015625
Epoch: 14 1.5176942724792752e-07
grad: 1.0 2.0 -0.00013256072998046875
Epoch: 15 4.393086783238687e-09
grad: 2.0 4.0 -0.0005197525024414062
Epoch: 15 1.68839164871315e-08
grad: 3.0 6.0 -0.00107574462890625
Epoch: 15 3.2145180739462376e-08
grad: 4.0 8.0 -0.001567840576171875
Epoch: 15 3.84081886295462e-08
grad: 1.0 2.0 -6.651878356933594e-05
Epoch: 16 1.1061871418860392e-09
grad: 2.0 4.0 -0.00026035308837890625
Epoch: 16 4.2364831642771605e-09
grad: 3.0 6.0 -0.000537872314453125
Epoch: 16 8.036295184865594e-09
grad: 4.0 8.0 -0.00078582763671875
Epoch: 16 9.648829291108996e-09
grad: 1.0 2.0 -3.337860107421875e-05
Epoch: 17 2.7853275241795927e-10
grad: 2.0 4.0 -0.00013065338134765625
Epoch: 17 1.0668941285985056e-09
grad: 3.0 6.0 -0.0002689361572265625
Epoch: 17 2.0090737962163985e-09
grad: 4.0 8.0 -0.000392913818359375
Epoch: 17 2.412207322777249e-09
grad: 1.0 2.0 -1.6689300537109375e-05
Epoch: 18 6.963318810448982e-11
grad: 2.0 4.0 -6.580352783203125e-05
Epoch: 18 2.7063151719630696e-10
grad: 3.0 6.0 -0.00013446807861328125
Epoch: 18 5.022684490540996e-10
grad: 4.0 8.0 -0.0001983642578125
Epoch: 18 6.148184183984995e-10
grad: 1.0 2.0 -8.344650268554688e-06
Epoch: 19 1.7408297026122455e-11
grad: 2.0 4.0 -3.24249267578125e-05
Epoch: 19 6.571099220309407e-11
grad: 3.0 6.0 -6.580352783203125e-05
Epoch: 19 1.2028067430946976e-10
grad: 4.0 8.0 -9.5367431640625e-05
Epoch: 19 1.4210854715202004e-10
grad: 1.0 2.0 -4.0531158447265625e-06
Epoch: 20 4.106937012693379e-12
grad: 2.0 4.0 -1.621246337890625e-05
Epoch: 20 1.6427748050773516e-11
grad: 3.0 6.0 -3.4332275390625e-05
Epoch: 20 3.2741809263825417e-11
grad: 4.0 8.0 -4.9591064453125e-05
Epoch: 20 3.842615114990622e-11
grad: 1.0 2.0 -2.1457672119140625e-06
Epoch: 21 1.1510792319313623e-12
grad: 2.0 4.0 -8.58306884765625e-06
Epoch: 21 4.604316927725449e-12
grad: 3.0 6.0 -1.71661376953125e-05
Epoch: 21 8.185452315956354e-12
grad: 4.0 8.0 -2.6702880859375e-05
Epoch: 21 1.1141310096718371e-11
grad: 1.0 2.0 -1.1920928955078125e-06
Epoch: 22 3.552713678800501e-13
grad: 2.0 4.0 -4.76837158203125e-06
Epoch: 22 1.4210854715202004e-12
grad: 3.0 6.0 -1.1444091796875e-05
Epoch: 22 3.637978807091713e-12
grad: 4.0 8.0 -1.52587890625e-05
Epoch: 22 3.637978807091713e-12
grad: 1.0 2.0 -7.152557373046875e-07
Epoch: 23 1.2789769243681803e-13
grad: 2.0 4.0 -2.86102294921875e-06
Epoch: 23 5.115907697472721e-13
grad: 3.0 6.0 -5.7220458984375e-06
Epoch: 23 9.094947017729282e-13
grad: 4.0 8.0 -1.1444091796875e-05
Epoch: 23 2.0463630789890885e-12
grad: 1.0 2.0 -4.76837158203125e-07
Epoch: 24 5.684341886080802e-14
grad: 2.0 4.0 -1.9073486328125e-06
Epoch: 24 2.2737367544323206e-13
grad: 3.0 6.0 -5.7220458984375e-06
Epoch: 24 9.094947017729282e-13
grad: 4.0 8.0 -7.62939453125e-06
Epoch: 24 9.094947017729282e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 25 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 25 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 25 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 25 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 26 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 26 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 26 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 26 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 27 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 27 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 27 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 27 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 28 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 28 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 28 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 28 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 29 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 29 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 29 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 29 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 30 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 30 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 30 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 30 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 31 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 31 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 31 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 31 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 32 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 32 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 32 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 32 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 33 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 33 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 33 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 33 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 34 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 34 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 34 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 34 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 35 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 35 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 35 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 35 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 36 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 36 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 36 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 36 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 37 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 37 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 37 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 37 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 38 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 38 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 38 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 38 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 39 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 39 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 39 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 39 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 40 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 40 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 40 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 40 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 41 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 41 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 41 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 41 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 42 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 42 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 42 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 42 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 43 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 43 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 43 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 43 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 44 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 44 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 44 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 44 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 45 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 45 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 45 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 45 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 46 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 46 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 46 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 46 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 47 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 47 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 47 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 47 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 48 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 48 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 48 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 48 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 49 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 49 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 49 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 49 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 50 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 50 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 50 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 50 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 51 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 51 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 51 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 51 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 52 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 52 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 52 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 52 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 53 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 53 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 53 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 53 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 54 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 54 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 54 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 54 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 55 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 55 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 55 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 55 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 56 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 56 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 56 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 56 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 57 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 57 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 57 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 57 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 58 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 58 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 58 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 58 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 59 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 59 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 59 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 59 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 60 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 60 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 60 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 60 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 61 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 61 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 61 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 61 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 62 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 62 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 62 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 62 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 63 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 63 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 63 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 63 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 64 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 64 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 64 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 64 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 65 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 65 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 65 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 65 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 66 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 66 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 66 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 66 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 67 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 67 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 67 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 67 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 68 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 68 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 68 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 68 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 69 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 69 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 69 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 69 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 70 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 70 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 70 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 70 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 71 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 71 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 71 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 71 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 72 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 72 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 72 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 72 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 73 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 73 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 73 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 73 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 74 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 74 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 74 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 74 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 75 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 75 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 75 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 75 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 76 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 76 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 76 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 76 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 77 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 77 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 77 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 77 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 78 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 78 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 78 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 78 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 79 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 79 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 79 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 79 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 80 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 80 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 80 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 80 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 81 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 81 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 81 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 81 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 82 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 82 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 82 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 82 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 83 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 83 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 83 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 83 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 84 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 84 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 84 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 84 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 85 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 85 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 85 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 85 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 86 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 86 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 86 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 86 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 87 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 87 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 87 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 87 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 88 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 88 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 88 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 88 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 89 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 89 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 89 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 89 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 90 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 90 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 90 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 90 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 91 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 91 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 91 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 91 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 92 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 92 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 92 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 92 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 93 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 93 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 93 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 93 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 94 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 94 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 94 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 94 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 95 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 95 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 95 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 95 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 96 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 96 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 96 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 96 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 97 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 97 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 97 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 97 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 98 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 98 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 98 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 98 2.2737367544323206e-13
grad: 1.0 2.0 -2.384185791015625e-07
Epoch: 99 1.4210854715202004e-14
grad: 2.0 4.0 -9.5367431640625e-07
Epoch: 99 5.684341886080802e-14
grad: 3.0 6.0 -2.86102294921875e-06
Epoch: 99 2.2737367544323206e-13
grad: 4.0 8.0 -3.814697265625e-06
Epoch: 99 2.2737367544323206e-13
Predict(after training) 4 7.999999523162842

算法中一些函数的区别

1.w.data 表示张量w的值,其本身也是张量,输出格式tensor[数]。
2.w.grad 表示张量w的梯度,其本身w.grad是张量 用时(标量计算时)需要取w.grad.data,表示张量w.grad的值,输出格式tensor[数],(梯度输出时)需要取w.grad.item(),表示返回的是一个具体的数值,输出格式 数
3.w.grad.item() l.item() 表示返回的是一个具体的数值,输出格式 数

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/683044.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

MySQL 基础知识(四)之表操作

目录 1 约束 2 查看已有表 3 创建表 4 查看表结构 5 修改表 6 删除表 1 约束 主键约束 primary key:唯一,标识表中的一行数据,此列的值不可重复,且不能为 NULL,此外,可以多个列组成主键唯一约束 uniq…

Phobos捆绑某数控软件AdobeIPCBroker组件定向勒索

前言 Phobos勒索病毒最早于2019年被首次发现并开始流行起来,该勒索病毒的勒索提示信息特征与CrySiS(Dharma)勒索病毒非常相似,但是两款勒索病毒的代码特征却是完全不一样,近日笔者在逛某开源恶意软件沙箱的时候发现了一款Phobos勒索病毒捆绑…

Windows编程环境配置!

喜欢的话麻烦大家多点点关注,谢谢! 原文地址:Windows编程环境配置! - Pleasure的博客 下面是正文内容: 前言 近期闲来无事,就想着把Windows系统中的环境给完善整理一下。方便后续码字时的不时之需。 正文…

百度云AI

百度云AI概述 Face腾讯优图科大讯飞 百度人脸识别基于深度学习的人脸识别方案,准确识别图片中的人脸信息,提供如下功能: 人脸检测:精准定位图中人脸,获得眼、口、鼻等72个关键点位置,分析性别、年龄、表…

[python] 罗技动态链接驱动库DLL 控制 键鼠

[python] 罗技动态链接驱动库DLL 控制 键鼠 最近在玩搬砖游戏晶核, 每天有很多重复繁琐的"打卡"操作, 得知隔壁御三家游戏就有大佬做了自动收割的辅助工具,我就想模仿写一个.不过大佬们写的开源工具厉害得多,加了神经网络自动识别,实现寻路和点击功能.我目前最多就是…

模拟电子技术——分压式偏置放大电路、多级放大电路、差动放大电路、互补输出级

文章目录 前言基本放大电路链接,上一篇 [基本放大电路](https://blog.csdn.net/weixin_47541751/article/details/136112075?spm1001.2014.3001.5502) 一、分压式偏置放大电路什么是分压式偏置电路分压式电路组成电路分析估算静态工作点 二、多级放大电路什么是多级…

仰暮计划|“他们吃树皮,挖野菜,将玉米棒和玉米皮也做成食物来解饥”

我的姥姥今年七十岁了,她病的很严重,我趁着在病房的这段时间对她进行了采访。 我的姥姥1953年出生在一个小山村里,她有四个兄弟和两个姐妹,据她说,她的父母既是爱她的又是严厉的,因为孩子多并且生活困难&a…

python - OSError:错误没有名为 [‘pytorch_model.bin‘

python - OSError:错误没有名为 [‘pytorch_model.bin’] 自己训练的模型存储好了以后 model MT5ForConditionalGeneration.from_pretrained(“ner/best”) 之前还可以跑 现在报错 错误没有名为 [‘pytorch_model.bin’] 还原了一下conda env 把四版变成三版了 …

C# CAD2016 判断多边形的方向正时针或逆时针旋转

方法一&#xff1a;基于相邻顶点相对位置判断顺时针排列 // 计算当前子序列是否为顺时针排列 for (int i 1; i < outerPoints.Count; i) {int index (startVertexIndex i) % outerPoints.Count;int prevIndex (startVertexIndex i - 1) % outerPoints.Count;Point2d c…

基于JAVA,SpringBoot和Vue二手房屋销售系统设计

摘要&#xff1a; 本研究旨在设计并实现一个基于JAVA, SpringBoot和Vue技术的二手房屋销售系统。该系统采用当前流行的前后端分离架构&#xff0c;后端使用SpringBoot框架快速搭建RESTful API&#xff0c;提供稳定且高效的服务端应用&#xff1b;前端则通过Vue.js框架构建动态…

Linux用户常用命令——Linux命令(一)

大家好&#xff0c;从这篇文章开始我将开始进行Linux常用命令的学习&#xff0c;本专栏的每一个知识点我都会尽量在Linux系统中手操实现一遍。如果在读这篇文章的你也想熟悉Linux常用操作命令&#xff0c;我非常推荐你也搭个Linux系统进行实操学习。因为Linux常用的命令的知识点…

Python算法探索:从经典到现代

引言 Python&#xff0c;作为一种功能强大的编程语言&#xff0c;一直是算法实现的首选工具。从经典的排序和查找算法到现代的机器学习和深度学习算法&#xff0c;Python都展现出了其强大的实力。接下来&#xff0c;我们将一起探索Python算法的经典与现代。 一、经典算法&#…

LabVIEW伺服阀动静态测试系统

LabVIEW伺服阀动静态测试系统 基于LabVIEW开发了一套伺服阀动静态测试系统&#xff0c;提高伺服阀在电液伺服控制系统中的性能测试精度和效率。通过设计合理的液压系统、电控系统及软件系统&#xff0c;实现了伺服阀的动态和静态特性测试&#xff0c;采用流量-压力双闭环稳态控…

【C语言】数据结构#实现堆

目录 &#xff08;一&#xff09;堆 &#xff08;1&#xff09;堆区与数据结构的堆 &#xff08;二&#xff09;头文件 &#xff08;三&#xff09;功能实现 &#xff08;1&#xff09;堆的初始化 &#xff08;2&#xff09;堆的销毁 &#xff08;3&#xff09;插入数据 …

快速部署MES源码/万界星空科技开源MES

什么是开源MES软件&#xff1f; 开源MES软件是指源代码可以免费获取、修改和分发的MES软件。与传统的商业MES软件相比&#xff0c;开源MES软件具有更高的灵活性和可定制性。企业可以根据自身的需求对软件进行定制化开发&#xff0c;满足不同生产环境下的特定需求。 开源MES软件…

稳压二极管应用电路

稳压二极管比较特殊&#xff0c;基本结构与普通二极管一样&#xff0c;也有一个PN结。由于制造工艺的不同&#xff0c;当这种PN结处于反向击穿状态时&#xff0c;PN结不会损坏(普通二极管的PN结是会损坏)&#xff0c;在稳压二极管用来稳定电压时就是利用它的这一击穿特性。 由…

串行通信的艺术:深入解析UART与奇偶校验

发送数据位是电流传输吗&#xff1f; 在UART&#xff08;Universal Asynchronous Receiver/Transmitter&#xff09;通信中&#xff0c;发送数据位不直接以电流的形式传输。而是通过改变电压水平或者光信号&#xff08;在光纤通信中&#xff09;来表示不同的数据位&#xff08…

中小学信息学奥赛CSP-J认证 CCF非专业级别软件能力认证-入门组初赛模拟题第二套(阅读程序题)

CSP-J入门组初赛模拟题二 二、阅读程序题 (程序输入不超过数组或字符串定义的范围&#xff0c;判断题正确填√错误填X;除特殊说明外&#xff0c;判断题 1.5分&#xff0c;选择题3分&#xff0c;共计40分) 第一题 1 #include<bits/stdc.h> 2 using namespace std; 3 i…

探索微信小程序的奇妙世界:从入门到进阶

文章目录 一、什么是微信小程序1.1 简要介绍微信小程序的定义和特点1.2 解释小程序与传统应用程序的区别 二、小程序的基础知识2.1 微信小程序的架构2.2 微信小程序生命周期的理解2.3 探索小程序的目录结构和文件类型 三、小程序框架和组件3.1 深入了解小程序框架的核心概念和原…

【无标题】Matlab之annotation函数——创建图形注释(箭头、椭圆、矩形)

应用1&#xff1a;创建文本箭头注释 创建一个简单线图并向图窗添加文本箭头。用归一化的图窗坐标指定文本箭头位置&#xff0c;起点为 (0.3,0.6)&#xff0c;终点为 (0.5,0.5)。通过设置 String 属性指定文本说明。 figure plot(1:10) x [0.3 0.5]; y [0.6 0.5]; annotation…