function_tools.py 文件源码

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

项目:kafe 作者: dsavoiu 项目源码 文件源码
def outer_product(input_array):
    r'''
    Takes a `NumPy` array and returns the outer (dyadic, Kronecker) product
    with itself. If `input_array` is a vector :math:`\mathbf{x}`, this returns
    :math:`\mathbf{x}\mathbf{x}^T`.
    '''
    la = len(input_array)

    # return outer product as numpy array
    return np.kron(input_array, input_array).reshape(la, la)

##############
# Decorators #
##############


# Main decorator for fit functions
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号