src/lstm/lstm.cpp
void LSTM::CountAlternators(const Network &other, TFloat *same, TFloat *changed) const {
  ASSERT_HOST(other.type() == type_);
  const LSTM *lstm = static_cast<const LSTM *>(&other);
  for (int w = 0; w < WT_COUNT; ++w) {
    if (w == GFS && !Is2D()) {
      continue;
    }
    gate_weights_[w].CountAlternators(lstm->gate_weights_[w], same, changed);
  }
  if (softmax_ != nullptr) {
    softmax_->CountAlternators(*lstm->softmax_, same, changed);
  }
}
// Sums the products of weight updates in *this and other, splitting into
// positive (same direction) in *same and negative (different direction) in
// *changed.
Sums the products of weight updates in *this and other, splitting into
positive (same direction) in *same and negative (different direction) in
changed.
Sums the products of weight updates in * this and other splitting into positive ( same direction ) in * same and negative ( different direction ) in changed .
void LSTM::CountAlternators(const Network &other, TFloat *same, TFloat *changed) const {
  ASSERT_HOST(other.type() == type_);
  const LSTM *lstm = static_cast<const LSTM *>(&other);
  for (int w = 0; w < WT_COUNT; ++w) {
    if (w == GFS && !Is2D()) {
      continue;
    }
    gate_weights_[w].CountAlternators(lstm->gate_weights_[w], same, changed);
  }
  if (softmax_ != nullptr) {
    softmax_->CountAlternators(*lstm->softmax_, same, changed);
  }
}
void LSTM :: CountAlternators ( const Network & other , TFloat * same , TFloat * changed ) const { ASSERT_HOST ( other . type ( ) == type_ ) ; const LSTM * lstm = static_cast < const LSTM * > ( & other ) ; for ( int w = 0 ; w < WT_COUNT ; ++ w ) { if ( w == GFS && ! Is2D ( ) ) { continue ; } gate_weights_ [ w ] . CountAlternators ( lstm -> gate_weights_ [ w ] , same , changed ) ; } if ( softmax_ != nullptr ) { softmax_ -> CountAlternators ( * lstm -> softmax_ , same , changed ) ; } }
Sums the products of weight updates in *this and other, splitting into
positive (same direction) in *same and negative (different direction) in
changed.
Sums the products of weight updates in * this and other splitting into positive ( same direction ) in * same and negative ( different direction ) in changed .