当前位置:网站首页>Machine learning notes temperature+softmax
Machine learning notes temperature+softmax
2022-06-28 19:23:00 【UQI-LIUWJ】
1 Introduce
belt temperature Of Softmax, Describe... With a formula , It can be expressed as
![S_\tau(x,y)=[\frac{exp(a_1/\tau)}{\sum exp(a_i/\tau)},\frac{exp(a_2/\tau)}{\sum exp(a_i/\tau)},\cdots,\frac{exp(a_i/\tau)}{\sum exp(a_i/\tau)}]](http://img.inotgo.com/imagesLocal/202206/28/202206281904099085_1.gif)
Feel it directly
import numpy as np
def exp_tem(x,tau):
return np.exp(x/tau)/sum(np.exp(x/tau))
print(exp_tem(np.array([1,2,3]),2))
#[0.18632372 0.30719589 0.50648039]
print(exp_tem(np.array([1,2,3]),1))
#[0.09003057 0.24472847 0.66524096]
print(exp_tem(np.array([1,2,3]),0.5))
#[0.01587624 0.11731043 0.86681333]It's not hard to find out ,t The bigger it is , The smaller the gap between the classes , Result more “ smooth ”;t The smaller it is , The greater the gap between the categories , Result more “ Sharp ”.
2 temperature The role of
I think it can be compared to reinforcement learning to some extent ε-greedy, If temperature The setting is relatively large , Then there is little difference between the classes , There is a high probability of choosing different classes , Got some exploration Space ; If temperature It's set smaller , Then the class with the greatest probability The resulting value will “ stand head and shoulders above others ”, So basically, this class is selected .
So we can set temperature
, As the model is updated ,temperature It's getting smaller , And gradually from exploration to turn to exploitation 了 .
reference : In depth learning temperature parameter What is it? - You know (zhihu.com)
边栏推荐
- 智能计算系统3 Plugin 集成开发的demo
- 机器学习笔记 temperature+Softmax
- About Significance Tests
- How to resolve kernel errors? Solution to kernel error of win11 system
- Try except add auxiliary new column
- 180.1. Log in continuously for n days (database)
- async-validator. JS data verifier
- 道路千万条,为什么这家创新存储公司会选这条?
- SQL Server2019 新建 SQL Server身份验证用户名 并登录
- Bayesian Reference problem, mCMC and variational reference
猜你喜欢

Variational graph auto-encoders (VGAE)

POI excel conversion tool

Cvpr2022 | Zhejiang University and ant group put forward a hierarchical residual multi granularity classification network based on label relation tree to model hierarchical knowledge among multi granu

OpenHarmony—内核对象事件之源码详解

About covariance and correlation

Hands on Teaching of servlet use (1)

NanoPC-T4(RK3399) game1 oled(I2C)显示时间天气温度

Bayesian Reference problem, mCMC and variational reference

Win11底部状态栏如何换成黑色?Win11底部状态栏换黑色的方法

SQL interview question: find the maximum number of consecutive login days
随机推荐
First day of new work
Question brushing analysis tool
180.1. Log in continuously for n days (database)
Double contextual relationship network for polyp segmentation
在arm版本rk3399中搭建halo博客
How to remove dataframe field column names
C language file operation
Cvpr2022 | Zhejiang University and ant group put forward a hierarchical residual multi granularity classification network based on label relation tree to model hierarchical knowledge among multi granu
SQL Server2019 新建 SQL Server身份验证用户名 并登录
Pipeline based hybrid rendering
devpi
腾讯汤道生:面向数实融合新世界,开发者是最重要的“建筑师”
Technical methodology of new AI engine under the data infrastructure upgrade window
Group programming TIANTI competition exercise - continuously updating
泰山OFFICE技术讲座:WORD奇怪的字体高度
深度学习需要多强的数学基础?
直播app系统源码,动态遇到视频时开始自动播放
Render function parsing
Opengauss kernel: analysis of SQL parsing process
数据库学习笔记(SQL04)