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]
Just in case this helps, scipy has a sigmoid function you can directly call on a matrix.