title: Sigmoid function of a 2D array
body: <p>Is there a way to find the sigmoid of a 2D array without using an external library like <a href="http://math.nist.gov/javanumerics/jama/" rel="nofollow">JAMA</a>?
  I have tried the following code, but in failure.</p>
  
  <pre><code>public static double[][] sigmoid(double[][] x, boolean deriv){
      for (int i = 0; i &lt;x.length ; i++)
      {
          for (int j = 0; j &lt; x[1].length; j++){
              if(deriv == false){
                  return sigmoid(x[i][j], false) * (1 - sigmoid(x[i][j], false));
              }
              return (1/(1 + Math.pow(Math.E, (-1 * x[i][j]))));
          }
      }
  }
  </code></pre>
  
  <p>It says, cannot convert double to double[][]. Any method to solve this would be appreciated. thank you!</p>