Change the activation function and adapt some ops to matlab