当前位置:网站首页>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]])
边栏推荐
- Depth first DFS and breadth first BFS -- traversing adjacency tables
- C language - structural basis
- Post-90s tester: "after joining Ali, this time, I decided not to change jobs."
- Double pointer of linked list (fast and slow pointer, sequential pointer, head and tail pointer)
- I closed the open source project alinesno cloud service
- Google Maps case
- Postman核心功能解析-参数化和测试报告
- thinkphp5.1跨域问题解决
- Nacos installation and service registration
- 50. Pow(x, n). O(logN) Sol
猜你喜欢

Paddle Serving v0.9.0 重磅发布多机多卡分布式推理框架

关于MySQL的30条优化技巧,超实用
![[error record] file search strategy in groovy project (src/main/groovy/script.groovy needs to be used in the main function | groovy script directly uses the relative path of code)](/img/b6/b2036444255b7cd42b34eaed74c5ed.jpg)
[error record] file search strategy in groovy project (src/main/groovy/script.groovy needs to be used in the main function | groovy script directly uses the relative path of code)

Google Maps case

Double pointer of linked list (fast and slow pointer, sequential pointer, head and tail pointer)

Metaverse Ape上线倒计时,推荐活动火爆进行

700. Search in a Binary Search Tree. Sol

Paddy serving v0.9.0 heavy release multi machine multi card distributed reasoning framework

d3dx9_ How to repair 31.dll_ d3dx9_ 31. Solution to missing DLL

The difference between MVVM and MVC
随机推荐
Nacos installation and service registration
H5c3 advanced - player
Metaverse Ape获Negentropy Capital种子轮融资350万美元
EasyCVR集群部署如何解决项目中的海量视频接入与大并发需求?
VOT Toolkit环境配置与使用
When the industrial Internet era is truly mature, we will look at the emergence of a series of new industrial giants
d3dx9_ How to repair 31.dll_ d3dx9_ 31. Solution to missing DLL
d3dx9_ What if 29.dll is missing? System missing d3dx9_ Solution of 29.dll file
MCU case -int0 and INT1 interrupt count
[secretly kill little buddy pytorch20 days] - [Day2] - [example of picture data modeling process]
VIM tail head intercept file import
Sub total of Pico development
链表之双指针(快慢指针,先后指针,首尾指针)
Vcomp110.dll download -vcomp110 What if DLL is lost
Pinctrl subsystem and GPIO subsystem
Spectrum analysis of ADC sampling sequence based on stm32
Go language learning tutorial (XV)
What changes has Web3 brought to the Internet?
Event trigger requirements of the function called by the event trigger
Paddy serving v0.9.0 heavy release multi machine multi card distributed reasoning framework