本文整理汇总了Python中Helper.Helper.getBandwidth方法的典型用法代码示例。如果您正苦于以下问题:Python Helper.getBandwidth方法的具体用法?Python Helper.getBandwidth怎么用?Python Helper.getBandwidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Helper.Helper
的用法示例。
在下文中一共展示了Helper.getBandwidth方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _updateKernelParameters
# 需要导入模块: from Helper import Helper [as 别名]
# 或者: from Helper.Helper import getBandwidth [as 别名]
def _updateKernelParameters(self, S, A, random=True, normalize=True):
SA = self._getStateActionMatrix(S, A)
if random:
self.MuS = Helper.getRandomSubset(S, self.numFeatures)
self.MuSA = Helper.getRandomSubset(SA, self.numFeatures)
else:
self.MuS = Helper.getRepresentativeRows(S, self.numFeatures, normalize)
self.MuSA = Helper.getRepresentativeRows(SA, self.numFeatures, normalize)
NUM_SAMPLES_FOR_BW_ESTIMATE = 500
# bandwidth for PHI_S
bwNonKbS = Helper.getBandwidth(self.MuS[:, 0:self.NUM_NON_KB_DIM],
NUM_SAMPLES_FOR_BW_ESTIMATE, self.bwFactorNonKbS)
kbPosS = self._reshapeKbPositions(self.MuS[:, self.NUM_NON_KB_DIM:])
bwKbS = Helper.getBandwidth(kbPosS, NUM_SAMPLES_FOR_BW_ESTIMATE,
self.bwFactorKbS)
self.kernelS.setBandwidth(bwNonKbS, bwKbS)
self.kernelS.setWeighting(self.weightNonKbS)
# bandwidth for PHI_SA
bwNonKbSA = Helper.getBandwidth(self.MuSA[:, 0:(self.NUM_NON_KB_DIM + 2)],
NUM_SAMPLES_FOR_BW_ESTIMATE, self.bwFactorNonKbSA)
kbPosSA = self._reshapeKbPositions(self.MuSA[:, (self.NUM_NON_KB_DIM + 2):])
bwKbSA = Helper.getBandwidth(kbPosSA, NUM_SAMPLES_FOR_BW_ESTIMATE,
self.bwFactorKbSA)
self.kernelSA.setBandwidth(bwNonKbSA, bwKbSA)
self.kernelSA.setWeighting(self.weightNonKbSA)
示例2: _updateBandwidthsGP
# 需要导入模块: from Helper import Helper [as 别名]
# 或者: from Helper.Helper import getBandwidth [as 别名]
def _updateBandwidthsGP(self, Ssub):
bwNonKb = Helper.getBandwidth(Ssub[:, 0:self.NUM_NON_KB_DIM],
Ssub.shape[0], self.bwFactorNonKbGP)
kbPos = Ssub[:, self.NUM_NON_KB_DIM:]
bwKb = Helper.getBandwidth(self._reshapeKbPositions(kbPos),
Ssub.shape[0], self.bwFactorKbGP)
self.policy.kernel.setBandwidth(bwNonKb, bwKb)
self.policy.kernel.setWeighting(self.weightNonKbGP)