当前位置:网站首页>CV review: softmax code implementation
CV review: softmax code implementation
2022-08-10 00:12:00 【pomelo33】
softmax function, also known as normalized exponential function.It is a binary classification function sigmoid in multi-classThe purpose of the generalization is to display the results of multi-classification in the form of probability.
1) Convert the forecast to a non-negative number
Convert a value to an exponential function
2) The sum of the probabilities of various prediction results is equal to 1
To ensure that the sum of the probabilities of each prediction result equals 1.We just need to normalize the transformed result.This is done by dividing the converted result by the sum of all the converted results, which can be understood as a percentage of the total converted results.This gives an approximate probability.
So the final formula of softmax is:

Code implementation:
Because the magnification of the exponential function is too obvious, if directly use the softmax calculation formulato implement the function, it will easily lead to data overflow (overflow).Therefore, we use its properties when implementing the function: first process the input data, and then use the calculation formula to calculate.Specifically, the implementation steps are as follows
边栏推荐
- 工作经验-组件封装(拖拽排序组件)
- 守护进程
- Blender程序化建模简明教程【PCG】
- R语言ggplot2可视化:使用ggpubr包的ggerrorplot函数可视化误差线(可视化不同水平均值点以及se标准误差)、设置add参数为dotplot添加点阵图
- [WeChat applet development (8)] Summary of audio background music playback problems
- R语言使用mean函数计算样本(观测)数据中指定变量的相对频数:计算时间序列数据中大于前一个观测值的观测值所占的比例总体的比例
- A. Common Prefixes
- D. Binary String To Subsequences
- 第 1 章 一大波数正在靠近——排序
- Leetcode.25 K个一组翻转链表(模拟/递归)
猜你喜欢
随机推荐
mysql 、pg 查询日期处理
js十五道面试题(含答案)
Swift 需求 如何防止把view重复添加到win里面
学习编程的第十二天
Arcgis工具箱无法使用,显示“XML包含错误“的解决方法
Qt message mechanism and events
17-GuliMall 搭建虚拟域名访问环境
MySQL——JDBC
One Pass 2074: [21CSPJ Popularization Group] Candy
关于ETL的两种架构(ETL架构和ELT架构)
leetcode:286.墙和门
干涉BGP的选路---社团属性
力扣 1413. 逐步求和得到正数的最小值
APS系统能消除造成生产和运输延迟的瓶颈
使用股票量化交易接口需要具备怎么样的心态
shell数组
EasyExcel使用
异常处理(try,catch,finally)
R语言修改dataframe数据列的名称:使用dplyr包的rename函数修改列名、使用colnmaes函数修改列名、在数据筛选的时候重命名列名
R语言ggplot2可视化:使用ggplot2可视化散点图、使用labs参数自定义Y轴的轴标签文本(customize Y axis labels)









