@Override
    public INDArray appendBias(INDArray... vectors) {
        int size = 0;
        for (INDArray vector : vectors) {
            size += vector.rows();
        }


        INDArray result = Nd4j.create(size + 1, vectors[0].columns());
        int index = 0;
        for (INDArray vector : vectors) {
            INDArray put = toFlattened(vector, Nd4j.ones(1));
            result.put(new INDArrayIndex[] {NDArrayIndex.interval(index, index + vector.rows() + 1),
                            NDArrayIndex.interval(0, vectors[0].columns())}, put);
            index += vector.rows();
        }

        return result;

    }
@Override
    public INDArray appendBias(INDArray... vectors) {
        int size = 0;
        for (INDArray vector : vectors) {
            size += vector.rows();
        }


        INDArray result = Nd4j.create(size + 1, vectors[0].columns());
        int index = 0;
        for (INDArray vector : vectors) {
            INDArray put = toFlattened(vector, Nd4j.ones(1));
            result.put(new INDArrayIndex[] {NDArrayIndex.interval(index, index + vector.rows() + 1),
                            NDArrayIndex.interval(0, vectors[0].columns())}, put);
            index += vector.rows();
        }

        return result;

    }
@ Override public INDArray appendBias ( INDArray ... vectors ) { int size = 0 ; for ( INDArray vector : vectors ) { size += vector . rows ( ) ; } INDArray result = Nd4j . create ( size + 1 , vectors [ 0 ] . columns ( ) ) ; int index = 0 ; for ( INDArray vector : vectors ) { INDArray put = toFlattened ( vector , Nd4j . ones ( 1 ) ) ; result . put ( new INDArrayIndex [ ] { NDArrayIndex . interval ( index , index + vector . rows ( ) + 1 ) , NDArrayIndex . interval ( 0 , vectors [ 0 ] . columns ( ) ) } , put ) ; index += vector . rows ( ) ; } return result ; }
Merge the vectors and append a bias.
Each vector must be either row or column vectors.
An exception is thrown for inconsistency (mixed row and column vectors)

@param vectors the vectors to merge
@return the merged ndarray appended with the bias
Merge the vectors and append a bias . Each vector must be either row or column vectors . An exception is thrown for inconsistency ( mixed row and column vectors )