当前位置:网站首页>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
边栏推荐
猜你喜欢

2022-8-9 第六组 输入输出流

The 2022-8-9 sixth group of input and output streams

Js fifteen interview questions (with answers)

JSON 基本使用

leetcode 38. 外观数列
![One Pass 2074: [21CSPJ Popularization Group] Candy](/img/72/d3e46a820796a48b458cd2d0a18f8f.png)
One Pass 2074: [21CSPJ Popularization Group] Candy

In-depth analysis of Apache EventMesh cloud-native distributed event-driven architecture

DXF笔记:文字对齐的研究

shell数组

反射机制篇
随机推荐
【微信小程序开发(八)】音频背景音乐播放问题汇总
【Leetcode】2104. Sum of Subarray Ranges
Under the NVM node installation;The node environment variable configuration
使用股票量化交易接口需要具备怎么样的心态
OKR 锦囊妙计
R语言patchwork包将多个可视化结果组合起来、使用plot_annotation函数以及tag_level参数将组合图用大写字母进行顺序编码、为组合图的标签添加自定义前缀信息
华为鸿蒙3.0的野望:技术、应用、生态
leetcode 38. 外观数列
请讲一讲JS中的 for...in 与 for...of (上)
聊天尬死名场面,你遇到过吗?教你一键获取斗图表情包,晋升聊天达人
每日一R「02」所有权与 Move 语义
Core Data浅谈系列之五 : 在UITableView中展示
xlrd 与 xlsxwritter 的基本操作
MySQL——JDBC
[Microservice~Nacos] Nacos service provider and service consumer
typedef和#define的花里胡哨的用法
CV复习:softmax代码实现
Basic JSON usage
大型分布式存储方案MinIO介绍,看完你就懂了!
阿里云架构师金云龙:基于云XR平台的视觉计算应用部署