 	
 	for(i = 0; i < hiddenSize; i++) {
 		for(j = 0; j < 1; j++) {
-			gradVec[offset + i + visibleSize*j] = hostb1grad[IND(i,j,hiddenSize)];
+			gradVec[offset + i + visibleSize*j] = hostb1grad[i];
 			printf("position %d , place %f \n", offset + i + visibleSize*j,  hostb1grad[IND(i,j,hiddenSize)]);
 		}
 	}


	dim3 dimBlock(N,1);
	dim3 dimGrid(1,1);
	compDelta<<<dimBlock, dimGrid>>>(delta2, a2, N);
}

__global__ void compDelta(float *delta, float *a2, int N) {

	printf("---------------------------\n");
	for(i = 0; i < numberOfRows; i++) {
		for(j = 0; j < numberOfCols; j++) {
			printf("RetMat[%d,%d] = %1.3f  ", i, j, ret[IND(i,j,numberOfRows)]);
		}
		printf("\n");
	}
