当前位置:网站首页>Torch. Distributions. Normal
Torch. Distributions. Normal
2022-06-13 01:39:00 【lainegates】
Pytorch Normal distribution provided , Official documents
How it was created
>>> m = Normal(torch.tensor([0.0]), torch.tensor([1.0]))
>>> m.sample() # Generate the data , Biography shape Parameters
tensor([ 0.1046])
Interface log_prob(self, value)
return value Probabilistic log value , The normal distribution formula is
f ( x ) = 1 2 π σ e x p ( − ( x − μ ) 2 2 σ 2 ) f(x)=\frac{1}{\sqrt{2\pi}\sigma}exp(-\frac{(x-\mu)^2}{2\sigma^2}) f(x)=2πσ1exp(−2σ2(x−μ)2)
The calculation formula of the function is :
l o g ( f ( x ) ) = − l o g ( 2 π ) − l o g ( σ ) − ( x − μ ) 2 2 σ 2 log(f(x)) = -log(\sqrt{2\pi})-log(\sigma)-\frac{(x-\mu)^2}{2\sigma^2} log(f(x))=−log(2π)−log(σ)−2σ2(x−μ)2
Interface def entropy(self)
Return value formula
1 2 + 2 π 2 + l o g ( σ ) \frac{1}{2}+\frac{2\pi}{2}+log(\sigma) 21+22π+log(σ)
It looks like the normal distribution formula log value , But I don't know why 1 2 \frac{1}{2} 21
边栏推荐
- [learn FPGA programming from scratch -22]: Advanced chapter - Architecture - Design and modeling of FPGA internal hardware circuit
- Page optimization - Notes
- Unity jsonutility failed to serialize list
- 三、上传织物图片至SQL Server并提供name进行展示织物照片
- About retrieving ignored files in cornerstone
- How does Apple add QQ email?
- Machine learning basic SVM (support vector machine)
- Docker install MySQL
- Add default right-click menu
- 兴趣相似的受众群体
猜你喜欢
随机推荐
The storage structure of a tree can adopt the parent representation, that is, the parent pointer array representation. Try to give the corresponding class definition. Each tree node contains two membe
[learn FPGA programming from scratch -22]: Advanced chapter - Architecture - Design and modeling of FPGA internal hardware circuit
MySQL connection query
Introduction to convolutional neural network
什么是立体角
[leetcode] valid phone number Bash
Method of cleaning C disk
Stack and queue practice (C language): Demon King's language
Exercise 5.14 input n strings, arrange them in alphabetical order and output them.
numpy多维数组转置transpose
兴趣相似的受众群体
MySQL download and installation
FLIP动画实现思路
Leetcode question brushing 06 bit operation
How to solve the problem of database?
Copy (copy) constructors and assignment overloaded operators=
redis
ES6解构赋值
Reinstall opencv and step on the pit.
Go JWT learning summary









