rbm.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:neurotools 作者: michaelerule 项目源码 文件源码
def hashint64(x,N):
    '''
    Convert a bit vector to a float128
    Not to be confused with `pylab.packbits`

    Parameters
    ----------
    x : boolean or binary vector
    N : positive integer, number of bits in each vector
    Returns
    -------
    int64 : integer, stored in int64, whose binary bits match x
    '''
    if N>63:
        raise ValueError('No more than 63 bits can be safely stored in int64')
    return x.dot(2**np.int64(np.arange(N)))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号