当前位置:网站首页>torch. Var (), sample variance, parent variance
torch. Var (), sample variance, parent variance
2022-06-11 08:12:00 【Interval】
List of articles
Classification of variance

There is an obvious difference between the two , Why is there such a difference ?
There are two differences , The two differences are interrelated , An integral :
- How much data . The above one is only a part of the sample , The following one has complete data , Overall , Mother .
- Purpose . You want to calculate the variance of this part of the data , Or estimate the variance of the population . If it's the former , Then use the matrix variance formula , If it's the latter , Use the sample variance formula .
Further explanation : When we only have part of the sample , Obviously, we cannot estimate the variance of the complete data ( The following formula ), therefore , The above formula is actually an approximate estimate , But the expectation of this estimate is equal to the variance of the complete data , Unbiased estimation .
torch.var
import torch
torch.var Both variances can be calculated , It depends on a parameter , namely unbiased, Unbiased meaning . The default value is true, in other words , The default goal is to sample the estimated population , The sample variance formula above is used , It calculates the sample variance .
Our actual combat view is as follows :
a=torch.tensor([1.0,-1])
torch.var(a)# The denominator is divided by 1.
give the result as follows :
tensor(2.)
a=torch.tensor([1.0,-1])
torch.var(a,unbiased=False)# The denominator is divided by 2.
give the result as follows :
tensor(1.)
边栏推荐
- Activity中,View#postDelay会导致内存泄漏,但是不会影响Activity的生命周期执行。
- Typescript null and undefined
- 如何做好空状态设计?来看这份全面总结
- 图数据库无缝集成Tushare接口
- TypeScript-枚举
- TRUNC in pytorch_ normal_ principle
- Receive ontrimmemory and other callbacks through componentcallbacks2 and mock the corresponding scenario
- 使用POSTMAN 测试firebase
- JSP technology: JSP overview, JSP basic syntax, JSP instructions, JSP implicit objects, JSP action elements
- Batch splice string
猜你喜欢

(the slow download speed of cifar10 in torchvision has been solved) how to download and use torchvision import

Figure seamless database integration tushare interface

Tidb Cloud est en ligne sur le marché Google Cloud pour permettre aux développeurs du monde entier d'utiliser une nouvelle pile de bases de données htap en temps réel

Getting started with bladed tutorial (video)

Bladed入門教程(視頻)

C language - growth diary-04- preliminary exploration of local variables (local variables)

TRUNC in pytorch_ normal_ principle

Development of sylixos SD device driver

Crawl Baidu Baipin dynamic page

Tidb cloud launched Google cloud marketplace, empowering global developers with a new stack of real-time HTAP databases
随机推荐
TypeScript-null和undefined
Record a murder case caused by ignoring the @suppresslint ("newapi") prompt
空间几何
node报错整理
C language to achieve three piece chess (not artificial mental retardation ha ha ha)
Printing diamond of beginner C
TypeScript-枚举
Login and parameterization of interface test
How many of the 50 questions about network knowledge can you answer correctly?
Typescript null and undefined
TypeScript-键盘映射
Testing firebase with postman
Sign in system design: how to draw the sign in function
El expressions and JSTL
TypeScript-可辨识联合
Request request object and response response object
Thoroughly remember the difference between ImageView background and SRC
Session and session management technology
How to make hyperlinks in RichTextBox- How can I make a hyperlink work in a RichTextBox?
Modulenotfounderror: no module named 'tensorboard in pytorch‘