当前位置: 首页>>代码示例>>Python>>正文


Python MBAR.getWeights方法代码示例

本文整理汇总了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)
开发者ID:jpthompson17,项目名称:pymbar,代码行数:14,代码来源:test_mbar.py

示例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]
开发者ID:Asagodi,项目名称:openpathsampling,代码行数:33,代码来源:sandbox.py


注:本文中的pymbar.MBAR.getWeights方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。