当前位置:网站首页>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]])
边栏推荐
- 抖音__ac_signature
- Search: Future Vision (moving sword)
- Event trigger requirements of the function called by the event trigger
- When the industrial Internet era is truly mature, we will look at the emergence of a series of new industrial giants
- 第一讲:蛇形矩阵
- Sparse array [matrix]
- Three "factions" in the metauniverse
- Golang writes the opening chapter of selenium framework
- Understand the basic concept of datastore in Android kotlin and why SharedPreferences should be stopped in Android
- Unique occurrence times of leetcode simple questions
猜你喜欢

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

Navigation day answer applet: preliminary competition of navigation knowledge competition

a-tree 树的全部展开和收起

Unity Max and min constraint adjustment

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

Search: Future Vision (moving sword)

Nanjing: full use of electronic contracts for commercial housing sales

What if win11 is missing a DLL file? Win11 system cannot find DLL file repair method
![[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)

Distributed resource management and task scheduling framework yarn
随机推荐
Nacos installation and service registration
MCU case -int0 and INT1 interrupt count
Depth first DFS and breadth first BFS -- traversing adjacency tables
VIM tail head intercept file import
Nanjing: full use of electronic contracts for commercial housing sales
Tiktok__ ac_ signature
Request preview display of binary data and Base64 format data
基于STM32的ADC采样序列频谱分析
Postman core function analysis - parameterization and test report
Sub total of Pico development
What about data leakage? " Watson k'7 moves to eliminate security threats
Platformio create libopencm3 + FreeRTOS project
Paddy serving v0.9.0 heavy release multi machine multi card distributed reasoning framework
APK加固技术的演变,APK加固技术和不足之处
2022 Software Test Engineer salary increase strategy, how to reach 30K in three years
Global and Chinese markets of industrial pH meters 2022-2028: Research Report on technology, participants, trends, market size and share
Promql demo service
Binary tree (III) -- heap sort optimization, top k problem
二叉树(二)——堆的代码实现
Evolution of APK reinforcement technology, APK reinforcement technology and shortcomings