当前位置:网站首页>Single precision, double precision and precision (Reprint)
Single precision, double precision and precision (Reprint)
2022-06-22 05:57:00 【Wangjianbo 09】
Floating point numbers are one of the most commonly used data types on computers , Some languages even have floating point numbers (Perl,Lua Classmate, don't run , It's about you ).
Commonly used floating-point numbers are double precision and single precision . besides , There is also a semi precision Dongdong .
Double precision 64 position , Single precision 32 position , Half precision is naturally 16 Yes. .
Half precision is NVIDIA in 2002 It came out in , Double precision and single precision are used to calculate , The purpose of semi precision is to reduce the cost of data transmission and storage .
In many scenes, the accuracy requirements are not so high , For example, distributed deep learning , If you use half precision , Compared with single precision, it can save half of the transmission cost . Considering that the model of deep learning may have hundreds of millions of parameters , Using half precision transmission is still very valuable .
Google Of TensorFlow Is to use 16 Floating point number of bits , However, they do not use the standard proposed by NVIDIA , But directly 32 The decimal part of the floating-point number of digits is truncated . It's said to be for less computation expensive...
Compare the following floating point numbers layout:
Double precision floating point

Single-precision floating-point

Semi precision floating point number

They all share 3 part , Sign bit , Index and mantissa . Different precision only means that the length of digits and trailing digits are different .
Parsing a floating point number is 5 Bar rule
If the exponent is all zero , The trailing digits are all zeros , That means 0
If the exponent is all zero , The trailing digit is non-zero , It means a very small number (subnormal), Calculation method (−1)^signbit × 2^−126 × 0.fractionbits
If the index bits are all 1, The trailing digits are all zeros , Indicates positive and negative infinity
If the index bits are all 1, The trailing digit is non-zero , Indicates that it is not a number NAN
The remaining calculation method is (−1)^signbit × 2^(exponentbits−127) × 1.fractionbits
Almost all commonly used languages do not provide half precision floating-point numbers , At this time, we need to transform ourselves
Original address :https://blog.csdn.net/sinat_24143931/article/details/78557852
边栏推荐
- Tensorflow 2. Chapter 14: callbacks and custom callbacks in keras
- Gerrit Code Review Setup
- [soft test] senior system architecture designer learning experience sharing
- 向量空間視角看高數(1)——系列簡介
- 机器学习笔记 六:逻辑回归中的多分类问题之数字识别
- Use and decoupling of the mobile terminal's realm database, and use OC realm safely across threads
- D3D学习笔记(1)—— SO 阶段介绍 AutoDraw使用条件
- Sogou input method cannot output Chinese
- C语言指针(进阶)
- Combinatorial logic described using SystemVerilog gate model
猜你喜欢

北峰助力南昌市应急管理局打造公专融合应急通信保障网

Analysis of annual average temperature based on TMP data in cru

Sourcetree reported an error SSH failure

Conversion between gray code and binary

Machine learning note 8: octave for handwritten digit recognition based on Neural Network

以太网通信协议

TCP连接细节问题

數據的存儲(進階)

Reptile initial and project

Keil调试时设置断点的高级用法
随机推荐
Matlab system identification
QEMU ARM interrupt system architecture 2
Market development trend forecast and investment risk outlook report of China's silicon carbide industry 2022-2027
RGB及sRGB与XYZ坐标转换
Golang Viper库入门教学
Unity 加密ASE 游戏数据
以太网UDP帧发包设计
P1061 [noip2006 popularization group] counting method of jam
TCP连接细节问题
Why is "CPS alliance marketing" the most cost-effective promotion method?
Analysis on the development status of China's copper aluminum composite bus industry and Research Report on investment opportunities 2022-2027
JTAG接口
C指針的理解
GrabCut分析
机器学习笔记 六:逻辑回归中的多分类问题之数字识别
信号输出库
Error: note: module requires go 1.17
Assertion based validation
BinaryFormatter 保存和加载游戏数据 For Unity
CLion安装下载