L1期货交易所程序化交易接口,范数是指向量中各个元素绝对值之和,也有个美称叫“稀疏规则算子”,又称曼哈顿距离,最小绝对偏差,最小绝对误差,又叫做taxicab-期货交易所程序化交易接口,norm或者Manhattan-期货交易所程序化交易接口,norm。这基本上是将目标值与估计值)之间的绝对差的总和最小化:
范数是数学中的一种基本概念。在泛函分析中,它定义在赋范线性空间中,并满足一定的条件,即非负性;齐次性;三角不等式。它常常被用来度量某个向量空间中的每个向量的长度或大小。
Asyoucanseeinthegraphic,theL1normisthedistanceyouhavetotravelbetweentheorigintothedestination,inawaythatresembleshowataxicabdrivesbetweencityblockstoarriveatitsdestination.
L2范数:||W||它也不逊于L1范数,它有两个美称,在回归里面,有人把有它的回归叫“岭回归”,有人也叫它“权值衰减weightdecay”,欧几里德距离,最小二乘。它基本上是最小化目标值与估计值之间的差的平方和的平方根
Itisactuallynotanorm..Correspondstothetotalnumberofnonzeroelementsinavector.
InL-infinitynorm,onlythelargestelementhasanyeffect.So,forexample,ifyourvectorrepresentsthecostofconstructingabuilding,byminimizingL-infinitynormwearereducingthecostofthemostexpensivebuilding.
好,到这里,我们大概知道了L1可以实现稀疏,但我们会想呀,为什么要稀疏?让我们的参数稀疏有什么好处呢?这里扯两点:
特征选择:大家对稀疏规则化趋之若鹜的一个关键原因在于它能实现特征的自动选择。一般来说,xi的大部分元素都是和最终的输出yi没有关系或者不提供任何信息的,在最小化目标函数的时候考虑xi这些额外的特征,虽然可以获得更小的训练误差,但在预测新的样本时,这些没用的信息反而会被考虑,从而干扰了对正确yi的预测。稀疏规则化算子的引入就是为了完成特征自动选择的光荣使命,它会学习地去掉这些没有信息的特征,也就是把这些特征对应的权重置为0。
AgoodpracticalexampleofL0normistheonethatgivesNishantShukla,whenhavingtwovectors.IftheL0normofthevectorsisequalto0,thentheloginissuccessful.Otherwise,iftheL0normis1,itmeansthateithertheusernameorpasswordisincorrect,butnotboth.Andlastly,iftheL0normis2,itmeansthatbothusernameandpasswordareincorrect.
OK,来个一句话总结:L1范数和L0范数可以实现稀疏,L1因具有比L0更好的优化求解特性而被广泛应用。
范数
L0范数是指向量中非0的元素的个数
ThereisoneconsiderationtotakewithL2norm,anditisthateachcomponentofthevectorissquared,andthatmeansthattheoutliershavemoreweighting,soitcanskewresults.
p范数:║x║p=1/p║x║_p=^{1/p}║x║p=1/p
AlsoknownasManhattanDistanceorTaxicabnorm.L1Normisthesumofthemagnitudesofthevectorsinaspace.Itisthemostnaturalwayofmeasuredistancebetweenvectors,thatisthesumofabsolutedifferenceofthecomponentsofthevectors.Inthisnorm,allthecomponentsofthevectorareweightedequally.
Isthemostpopularnorm,alsoknownastheEuclideannorm.Itistheshortestdistancetogofromonepointtoanother.
其他资料:
Givesthelargestmagnitudeamongeachelementofavector.给出向量的每个元素中的最大幅度。
当p取的时候分别是以下几种最简单的情形:1-范数:║x║1=│x1│+│x2│+…+│xn│║x║_1=│x1│+│x2│+…+│xn│║x║1=│x1│+│x2│+…+│xn│2-范数:║x║2=1/2║x║_2=^{1/2}║x║2=1/2∞-范数:║x║∞=max║x║_∞=max║x║∞=max
Forexample,theL0normofthevectorsandis1becausethereisonlyonenonzeroelement.
文章为作者独立观点,不代表股票交易接口观点