src/main/java/convnet/NumPute.java
/**
     * Returns a matrix of given shape filled with zeros.
     * @param shape
     * @return
     */
Returns a matrix of given shape filled with zeros.
@param shape
@return
Returns a matrix of given shape filled with zeros . @param shape @return
public static double[][] zeros(int[] shape) {
        int m = shape[0];
        int n = shape[1];
        double[][] result = new double[m][n];
        for (int i = 0; i < m; i++) {
            for (int j = 0; j < n; j++) {
                result[i][j] = 0;
            }
        }
        return result;
    }
public static double [ ] [ ] zeros ( int [ ] shape ) { int m = shape [ 0 ] ; int n = shape [ 1 ] ; double [ ] [ ] result = new double [ m ] [ n ] ; for ( int i = 0 ; i < m ; i ++ ) { for ( int j = 0 ; j < n ; j ++ ) { result [ i ] [ j ] = 0 ; } } return result ; }
Returns a matrix of given shape filled with zeros.
Returns a matrix of given shape filled with zeros .