npmat.py 文件源码

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

项目:DeepNeuralNet-QSAR 作者: Merck 项目源码 文件源码
def add_col_mult(self, vec, mult, target = None):
        """
        Add a multiple of vector vec to every column of the matrix. If a target
        is provided, it is used to store the result instead of self.
        """

        a, b = self.shape
        a_, b_ = vec.shape

        if not (b_ == 1 and a_ == a):
            raise IncompatibleDimensionsException


        if target is None:
            target = self

        target.resize(self.shape)

        target.numpy_array[:] = self.numpy_array + vec.numpy_array * mult

        return target
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号