当前位置:网站首页>Activate function and its gradient
Activate function and its gradient
2022-07-05 22:43:00 【dying_ star】
Activation function ----sigmoid()

tanh Activation function
relu Activation function 
softmax Activation function


here yi representative pi, zi Independent variable ,0<=pi<=1,p1+p2+...+pi+...+pc=1
Find gradient function

autograd.grad() Directly return gradient information
.backward() Attach gradient attributes to variables
Perceptron gradient derivation
import torch
from torch.nn import functional as F
x=torch.randn(1,10)
w=torch.randn(2,10,requires_grad=True)# Mark w For objects that need gradient information
o=torch.sigmoid([email protected]())# To sum by weight , use sigmoid() Activation function
loss=F.mse_loss(torch.ones(1,2),o)# Mean square loss function
loss.backward()# Right w Gradient of
print(w.grad)Output gradient
tensor([[ 0.0066, -0.0056, -0.0027, 0.0118, -0.0050, 0.0314, 0.0100, -0.0274,
-0.0006, -0.0448],
[ 0.0182, -0.0155, -0.0075, 0.0326, -0.0138, 0.0871, 0.0277, -0.0760,
-0.0017, -0.1241]])
边栏推荐
- Nanjing: full use of electronic contracts for commercial housing sales
- Calculation method of boundary IOU
- QT creator 7 beta release
- Double pointer of linked list (fast and slow pointer, sequential pointer, head and tail pointer)
- 二叉树(三)——堆排序优化、TOP K问题
- Starting from 1.5, build a micro Service Framework -- log tracking traceid
- 请求二进制数据和base64格式数据的预览显示
- Technology cloud report won the special contribution award for the 10th anniversary of 2013-2022 of the "cloud Ding Award" of the global cloud computing conference
- 从 1.5 开始搭建一个微服务框架——日志追踪 traceId
- 2022-07-05: given an array, you want to query the maximum value in any range at any time. If it is only established according to the initial array and has not been modified in the future, the RMQ meth
猜你喜欢

點到直線的距離直線的交點及夾角

Paddy serving v0.9.0 heavy release multi machine multi card distributed reasoning framework
![[untitled]](/img/98/aa874a72f33edf416f38cb6e92f654.png)
[untitled]

The difference between MVVM and MVC

Metaverse ape ape community was invited to attend the 2022 Guangdong Hong Kong Macao Great Bay metauniverse and Web3.0 theme summit to share the evolution of ape community civilization from technology
![[error record] groovy function parameter dynamic type error (guess: groovy.lang.missingmethodexception: no signature of method)](/img/3e/34b45cd14f0302bb381efd244bc68f.jpg)
[error record] groovy function parameter dynamic type error (guess: groovy.lang.missingmethodexception: no signature of method)

Starting from 1.5, build a micro Service Framework -- log tracking traceid

The difference between MVVM and MVC

从 1.5 开始搭建一个微服务框架——日志追踪 traceId

Cobaltstrike builds an intranet tunnel
随机推荐
Ieventsystemhandler event interface
第一讲:蛇形矩阵
Double pointer of linked list (fast and slow pointer, sequential pointer, head and tail pointer)
Matlab draws a cute fat doll
Metaverse ape ape community was invited to attend the 2022 Guangdong Hong Kong Macao Great Bay metauniverse and Web3.0 theme summit to share the evolution of ape community civilization from technology
ESP32 hosted
我对新中台模型的一些经验思考总结
When the industrial Internet era is truly mature, we will look at the emergence of a series of new industrial giants
Promql demo service
Text组件新增内容通过tag_config设置前景色、背景色
二叉树(二)——堆的代码实现
QT creator 7 beta release
从 1.5 开始搭建一个微服务框架——日志追踪 traceId
First, redis summarizes the installation types
Starting from 1.5, build a micro Service Framework -- log tracking traceid
Thinkphp5.1 cross domain problem solving
鏈錶之雙指針(快慢指針,先後指針,首尾指針)
Paddy serving v0.9.0 heavy release multi machine multi card distributed reasoning framework
Distance entre les points et les lignes
南京:全面启用商品房买卖电子合同