How to apply a function / map values of each element in a 2d numpy array/matrix?

后端 未结 2 489
自闭症患者
自闭症患者 2020-12-25 09:50

Given the following numpy matrix:

import numpy as np
mymatrix = mymatrix = np.matrix(\'-1 0 1; -2 0 2; -4 0 4\')


matrix([[-1,  0,  1],
        [-2,  0,  2]         


        
2条回答
  •  感动是毒
    2020-12-25 10:35

    Just in case this helps, scipy has a sigmoid function you can directly call on a matrix.

提交回复
热议问题