 #if 1
 /* stochastic gradient descent */
   int iter = 0;
-//  int batchSize = 64;
-
-//  printf("Learning rate Lambda is %f\n",lambda);
- // printf("Batchsize is %d\n",batchSize);
 
   while(iter < iterations )
   {
-//  for( int i = 0; i < 500; i++ )
- // {
     for( int j = 0; j < Xexamples; j+=batchSize )
     {
-   //   int j = (int) ((double(rand()) / (double(RAND_MAX) + 1.0))*5000);
       
       costFunction( &X[INDX(0,j,Xfeatures)], batchSize, Xfeatures,
                     theta1, theta1Rows, theta1Cols, 

                                theta2Rows * theta2Cols );

  tempMatrix = (floatType_t *) malloc( sizeof(floatType_t) *
                               ( Xexamples * (theta1Rows+1) + 
                                 Xexamples * (theta1Rows+1) +
                                 Xexamples * (theta2Rows+1) + 
                                 theta2Cols + 11) );

  for( int i = 0; i < Xexamples; i++ ) 
    X[INDX(0,i,Xfeatures)] = (floatType_t) 1.0;

                    &cost, theta1Grad, theta2Grad, 
                    tempMatrix );

      for( int i = 0; i < theta1Rows*theta1Cols; i++ )
        theta1[i] -= lambda * theta1Grad[i];

      for( int i = 0; i < theta2Rows*theta2Cols; i++ )
        theta2[i] -= lambda * theta2Grad[i];
    } 
    iter++;
    printf("|");
    fflush(stdout);
    if( iter % 72 == 0 ) printf("\n");
