TypeError: unsupported operand type(s) for ^: ‘float’ and ‘int’
Solution: Changed the multiplication sign ^ to **
TypeError: type numpy.ndarray doesn’t define __round__ method
Solution: change round() to np.round()
TypeError: ufunc ‘bitwise_xor’ not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ”safe”
Solution: change ^ to **
TypeError: only size-1 arrays can be converted to Python scalars
Solution: change math.exp to np.exp()
Reason: sigma is a numpy matrix, use numpy.exp to handle it