问题:
高效找答案就上答案窝。欢迎访问daanwo.com
[单选题]对于给定的下面的一段python程序及其输出,下面的说法正确的是
NLR答案窝(daanwo.com)-大学作业答案分享平台import numpy as np
NLR答案窝(daanwo.com)-大学作业答案分享平台a=np.asarray([0.5,0.5]) #假设a为实际分布
NLR答案窝(daanwo.com)-大学作业答案分享平台b=np.array([0.25,0.75])
NLR答案窝(daanwo.com)-大学作业答案分享平台c=np.array([0.125,0.875])
NLR答案窝(daanwo.com)-大学作业答案分享平台kl1=np.sum(a*np.log(a/b))
NLR答案窝(daanwo.com)-大学作业答案分享平台print ("b,a",kl1)
NLR答案窝(daanwo.com)-大学作业答案分享平台kl2=np.sum(a*np.log(a/c))
NLR答案窝(daanwo.com)-大学作业答案分享平台print ("c,a",kl2)
NLR答案窝(daanwo.com)-大学作业答案分享平台其输出结果为
NLR答案窝(daanwo.com)-大学作业答案分享平台b,a 0.143841036226
NLR答案窝(daanwo.com)-大学作业答案分享平台c,a 0.413339286592
A程序的输出是计算了条件熵NLR答案窝(daanwo.com)-大学作业答案分享平台
B程序的输出是计算了互信息NLR答案窝(daanwo.com)-大学作业答案分享平台
Cb和c相比,更接近实际分布aNLR答案窝(daanwo.com)-大学作业答案分享平台
Dc和b相比,更接近实际分布a
高效找答案就上答案窝。欢迎访问daanwo.com