深度学习之反向传播算法

news2024/11/26 7:30:45

反向传播算法

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

数学公式

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

算法代码

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

import numpy as np
import matplotlib.pyplot as ply

#反向传播算法,需要使用pytorch框架,
#这里导入pytorch框架,用torch

import 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*x

def loss(x, y):
    y_pred = forward(x)
    return (y_pred - y)**2

print('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是一个张量,所以要取data
        w.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.coloradmin.cn/o/1449139.html

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

相关文章

力扣_面试题:配对交换

配对交换 链接:力扣(LeetCode)官网 - 全球极客挚爱的技术成长平台 题目意思就是交换相邻两个二进制位 ,用&分别取出even(偶位和)odd(奇位和) 偶位和用0xAAAAAAAA,奇…

[数学建模] 计算差分方程的收敛点

[数学建模] 计算差分方程的收敛点 差分方程:差分方程描述的是在离散时间下系统状态之间的关系。与微分方程不同,差分方程处理的是在不同时间点上系统状态的变化。通常用来模拟动态系统,如在离散时间点上更新状态并预测未来状态。 收敛点&…

4核16g云服务器多少钱?

4核16G服务器租用优惠价格26元1个月,腾讯云轻量4核16G12M服务器32元1个月、96元3个月、156元6个月、312元一年,阿腾云atengyun.com分享4核16服务器租用费用价格表,阿里云和腾讯云详细配置报价和性能参数表: 腾讯云4核16G服务器价…

2024年2月份实时获取地图边界数据方法,省市区县街道多级联动【附实时geoJson数据下载】

首先,来看下效果图 在线体验地址:https://geojson.hxkj.vip,并提供实时geoJson数据文件下载 可下载的数据包含省级geojson行政边界数据、市级geojson行政边界数据、区/县级geojson行政边界数据、省市区县街道行政编码四级联动数据&#xff0…

C#使用迭代器显示公交车站点

目录 一、涉及到的知识点 1.迭代器 2.IList接口及实现IList接口的Add方法 二、实例 1.源码 2.生成效果 一、涉及到的知识点 1.迭代器 迭代器是.NET 4.5开始的一个新特性,它是可以返回相同类型的值的有序序列的一段代码。迭代器可用作方法、运算符或get访问器…

Java安全 CC链6分析

CC链6分析 前言CC链分析核心transform链Lazymap类TiedMapEntry类HashMap方法 最终exp 前言 CC链6不受jdk版本与cs版本的影响,在Java安全中最为通用,并且非常简洁,非常有学习的必要,建议在学习CC链6之前先学习一下 URLDNS链 和 CC…

【Python如何通过多种方法输出九九乘法表】

1、九九乘法表方法一: for i in range(1, 10): # 对i在1到9进行循环(不包括10)for j in range(1, i 1): # 对j在1到i进行循环(不包括i)print(%d * %d %2d % (j, i, j * i), end ) # 对j,i进行格式化输出&#x…

【C++函数探幽】内联函数inline

📙 作者简介 :RO-BERRY 📗 学习方向:致力于C、C、数据结构、TCP/IP、数据库等等一系列知识 📒 日后方向 : 偏向于CPP开发以及大数据方向,欢迎各位关注,谢谢各位的支持 目录 1. 前言2.概念3.特性…

位图

目录 位图的概念 位图的实现 寻找位置 set reset test 面试题 1.给定100亿个整数,设计算法找到只出现一次的整数? 2. 给两个文件,分别有100亿个整数,我们只有1G内存,如何找到两个文件交集? 3. 位…

SpringBoot Starter造了个自动锁轮子

可能有人会有疑问,为什么外面已经有更好的组件,为什么还要重复的造轮子,只能说,别人的永远是别人的,自己不去造一下,就只能知其然,而不知其所以然。(其实就为了卷) 在日常…

VS Code之Java代码重构和源代码操作

文章目录 支持的代码操作列表调用重构分配变量字段和局部变量的差别Assign statement to new local variable在有参构造函数中将参数指定成一个新的字段 将匿名类转换为嵌套类什么是匿名类?匿名类转换为嵌套类的完整演示 转换为Lambda表达式Lambda 表达式是什么?转…

【OrangePi Zero2 智能家居】智能家居项目的软件实现

一、项目整体设计 二、项目代码的前期准备 三、实现语音监听接口 四、实现socket监听接口 五、实现烟雾报警监听接口 六、实现设备节点代码 七、实现接收消息处理接口 一、项目整体设计 整体的软件框架大致如下: 整个项目开启4个监听线程, 分别是&…

Java常用类与基础API--String的构造器与常用方法

文章目录 一、String的常用API-1(1)构造器1、介绍2、举例 (2)String与其他结构间的转换1、基本数据类型、包装类 --> 字符串2、字符串 --> 基本数据类型、包装类3、字符串 --> 字符数组4、字符数组 --> 字符串5、字符…

C++类和对象-C++运算符重载->加号运算符重载、左移运算符重载、递增运算符重载、赋值运算符重载、关系运算符重载、函数调用运算符重载

#include<iostream> using namespace std; //加号运算符重载 class Person { public: Person() {}; Person(int a, int b) { this->m_A a; this->m_B b; } //1.成员函数实现 号运算符重载 Person operator(const Per…

4核16G服务器价格腾讯云PK阿里云

4核16G服务器租用优惠价格26元1个月&#xff0c;腾讯云轻量4核16G12M服务器32元1个月、96元3个月、156元6个月、312元一年&#xff0c;阿腾云atengyun.com分享4核16服务器租用费用价格表&#xff0c;阿里云和腾讯云详细配置报价和性能参数表&#xff1a; 腾讯云4核16G服务器价…

JavaWeb学习|Filter与ThreadLocal

学习材料声明 所有知识点都来自互联网&#xff0c;进行总结和梳理&#xff0c;侵权必删。 引用来源&#xff1a;尚硅谷最新版JavaWeb全套教程,java web零基础入门完整版 Filter 1、Filter 过滤器它是 JavaWeb 的三大组件之一。三大组件分别是&#xff1a;Servlet 程序、Liste…

Oracle数据库自动维护任务(Automated Maintenance Tasks)

Oracle数据库自动维护任务(Automated Maintenance Tasks) Oracle数据库有以下预定义的自动维护任务: Automatic Optimizer Statistics Collection - 收集数据库中没有统计信息或只有过时统计信息的所有模式对象的优化器统计信息。SQL查询优化器使用该任务收集的统计信息来提高…

数学实验第三版(主编:李继成 赵小艳)课后练习答案(十)(2)(3)

实验十&#xff1a;非线性函数极值求解 练习二 1.求解极值问题: (1) s.t. function [c,ceq]fun(x) c(1)-(25-x(1)^2-x(2)^2); c(2)-(7-x(1)^2x(2)^2); ceq0;换一个窗口运行下面的程序&#xff1a; clc;clear; f(x)-2*x(1)-x(2); a[]; b[]; aeq[];beq[]; u[5;10]; l[0;0];…

一起玩儿Proteus仿真(C51)——06. 红绿灯仿真(二)

摘要&#xff1a;本文介绍如何仿真红绿灯 今天来看一下红绿灯仿真程序的具体实现方法。先来看一下整个程序的原理图。 在这个红绿灯仿真实验中&#xff0c;每个路口需要控制的设备是2位数码管显示倒计时以及红黄绿灯的亮灭。先来看一下数码管的连接方法。 数码管的8根LED显示…

解决Windows更新后无法启动的十种办法,总有一种适合你

你可能已经更新了操作系统以修复错误或使用最新功能。但是,如果Windows在更新后无法启动呢? 如果你面临这样的问题,主要是由于安装文件中的错误或你的系统与最新更新不兼容。此外,损坏的MBR或驱动程序也会阻止电脑启动。 不管是什么原因,本文将用十种简单的技术来指导你…