function res = simple_mlp_tanhderiv(mat)
% Derivative of the hyperbolic tangent activation function.
% TODO: Basically this could be parameterized (as in alpha * tanh(beta*x))
  res = 1 - mat .* mat;
