@Override protected float[] backwardPropagationO2H(Instance instance,float[] input){
  float[] output=Arrays.copyOf(instance.getScores(),getLabelSize());
  float[] gradients=getGradientsRegression(instance);
  for (int index=0; index < gradients.length; index++) {
    gradients[index]=-1 * gradients[index];
  }
  float[] errors=new float[input.length];
  int index;
  MajorVector weights=w_h2o.getDenseWeightVector();
  for (int y=0; y < gradients.length; y++) {
    for (int xi=0; xi < input.length; xi++) {
      if (sampled_thinned_network[sampled_thinned_network.length - 1][1 + xi]) {
        index=weights.indexOf(y,xi);
        errors[xi]+=gradients[y] * output[y] * weights.get(index);
        weights.add(index,-1 * getLearningRate(index,false) * gradients[y]* input[xi]);
      }
    }
  }
  return errors;
}

@ Override protected float [ ] backwardPropagationO2H ( Instance instance , float [ ] input ) { float [ ] output = Arrays . copyOf ( instance . getScores ( ) , getLabelSize ( ) ) ; float [ ] gradients = getGradientsRegression ( instance ) ; for ( int index = 0 ; index < gradients . length ; index ++ ) { gradients [ index ] = - 1 * gradients [ index ] ; } float [ ] errors = new float [ input . length ] ; int index ; MajorVector weights = w_h2o . getDenseWeightVector ( ) ; for ( int y = 0 ; y < gradients . length ; y ++ ) { for ( int xi = 0 ; xi < input . length ; xi ++ ) { if ( sampled_thinned_network [ sampled_thinned_network . length - 1 ] [ 1 + xi ] ) { index = weights . indexOf ( y , xi ) ; errors [ xi ] += gradients [ y ] * output [ y ] * weights . get ( index ) ; weights . add ( index , - 1 * getLearningRate ( index , false ) * gradients [ y ] * input [ xi ] ) ; } } } return errors ; }
found a minor bug : < br > need to check if the weights of the connections from bias units get updated in back propagation or not . < br >
