本文整理汇总了Python中pymbar.MBAR.getWeights方法的典型用法代码示例。如果您正苦于以下问题:Python MBAR.getWeights方法的具体用法?Python MBAR.getWeights怎么用?Python MBAR.getWeights使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pymbar.MBAR
的用法示例。
在下文中一共展示了MBAR.getWeights方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_mbar_getWeights
# 需要导入模块: from pymbar import MBAR [as 别名]
# 或者: from pymbar.MBAR import getWeights [as 别名]
def test_mbar_getWeights():
""" testing getWeights """
for system_generator in system_generators:
name, test = system_generator()
x_n, u_kn, N_k_output, s_n = test.sample(N_k, mode='u_kn')
mbar = MBAR(u_kn, N_k)
# rows should be equal to zero
W = mbar.getWeights()
sumrows = np.sum(W,axis=0)
eq(sumrows, np.ones(len(sumrows)), decimal=precision)
示例2: MBAR
# 需要导入模块: from pymbar import MBAR [as 别名]
# 或者: from pymbar.MBAR import getWeights [as 别名]
print "Interfaces"
# Create Interaces around first and last frame of the first trajectory and use only solute coordinates
traj = simulator.storage.trajectory(1)[ [0,-1] ].solute
# mat = tis.compute_N_IJ_l_kI()
# print mat
if simulator.storage.number_of_trajectories() > 100:
u_kln, N_k = tis.compute_mbar_array(0, 0, infinite_energy = 1e5)
mbar = MBAR(u_kln, N_k, method = 'adaptive', relative_tolerance=1.0e-10, verbose=False)
weights = mbar.getWeights()
n = np.zeros(weights.shape, dtype='float')
print np.exp(-mbar.f_k)
print N_k
index = 0
for k,n_samples in enumerate(N_k):
n[index:index+int(n_samples),0:k+1] = 1.0
index += int(n_samples)
print n
print weights[:,0]
print weights[:,2]