src/lstm/lstm.cpp
void LSTM::PrintDW() {
  tprintf("Delta state:%s\n", name_.c_str());
  for (int w = 0; w < WT_COUNT; ++w) {
    if (w == GFS && !Is2D()) {
      continue;
    }
    tprintf("Gate %d, inputs\n", w);
    for (int i = 0; i < ni_; ++i) {
      tprintf("Row %d:", i);
      for (int s = 0; s < ns_; ++s) {
        tprintf(" %g", gate_weights_[w].GetDW(s, i));
      }
      tprintf("\n");
    }
    tprintf("Gate %d, outputs\n", w);
    for (int i = ni_; i < ni_ + ns_; ++i) {
      tprintf("Row %d:", i - ni_);
      for (int s = 0; s < ns_; ++s) {
        tprintf(" %g", gate_weights_[w].GetDW(s, i));
      }
      tprintf("\n");
    }
    tprintf("Gate %d, bias\n", w);
    for (int s = 0; s < ns_; ++s) {
      tprintf(" %g", gate_weights_[w].GetDW(s, na_));
    }
    tprintf("\n");
  }
}
// Prints the weight deltas for debug purposes.
Prints the weight deltas for debug purposes.
Prints the weight deltas for debug purposes .
void LSTM::PrintDW() {
  tprintf("Delta state:%s\n", name_.c_str());
  for (int w = 0; w < WT_COUNT; ++w) {
    if (w == GFS && !Is2D()) {
      continue;
    }
    tprintf("Gate %d, inputs\n", w);
    for (int i = 0; i < ni_; ++i) {
      tprintf("Row %d:", i);
      for (int s = 0; s < ns_; ++s) {
        tprintf(" %g", gate_weights_[w].GetDW(s, i));
      }
      tprintf("\n");
    }
    tprintf("Gate %d, outputs\n", w);
    for (int i = ni_; i < ni_ + ns_; ++i) {
      tprintf("Row %d:", i - ni_);
      for (int s = 0; s < ns_; ++s) {
        tprintf(" %g", gate_weights_[w].GetDW(s, i));
      }
      tprintf("\n");
    }
    tprintf("Gate %d, bias\n", w);
    for (int s = 0; s < ns_; ++s) {
      tprintf(" %g", gate_weights_[w].GetDW(s, na_));
    }
    tprintf("\n");
  }
}
void LSTM :: PrintDW ( ) { tprintf ( " \n " , name_ . c_str ( ) ) ; for ( int w = 0 ; w < WT_COUNT ; ++ w ) { if ( w == GFS && ! Is2D ( ) ) { continue ; } tprintf ( " \n " , w ) ; for ( int i = 0 ; i < ni_ ; ++ i ) { tprintf ( " " , i ) ; for ( int s = 0 ; s < ns_ ; ++ s ) { tprintf ( " " , gate_weights_ [ w ] . GetDW ( s , i ) ) ; } tprintf ( " \n " ) ; } tprintf ( " \n " , w ) ; for ( int i = ni_ ; i < ni_ + ns_ ; ++ i ) { tprintf ( " " , i - ni_ ) ; for ( int s = 0 ; s < ns_ ; ++ s ) { tprintf ( " " , gate_weights_ [ w ] . GetDW ( s , i ) ) ; } tprintf ( " \n " ) ; } tprintf ( " \n " , w ) ; for ( int s = 0 ; s < ns_ ; ++ s ) { tprintf ( " " , gate_weights_ [ w ] . GetDW ( s , na_ ) ) ; } tprintf ( " \n " ) ; } }
Prints the weight deltas for debug purposes.
Prints the weight deltas for debug purposes .