parameters: (num_hidden, indata, prev_state, param, seqidx, layeridx, dropout=0.)
return_statement: return LSTMState(c=next_c, h=next_h)
docstring: LSTM Cell symbol
docstring_summary: LSTM Cell symbol
docstring_tokens: LSTM Cell symbol
function: def lstm(num_hidden, indata, prev_state, param, seqidx, layeridx, dropout=0.):
      """LSTM Cell symbol"""
      if dropout > 0.:
          indata = mx.sym.Dropout(data=indata, p=dropout)
      i2h = mx.sym.FullyConnected(data=indata,
                                  weight=param.i2h_weight,
                                  bias=param.i2h_bias,
                                  num_hidden=num_hidden * 4,
                                  name="t%d_l%d_i2h" % (seqidx, layeridx))
      h2h = mx.sym.FullyConnected(data=prev_state.h,
                                  weight=param.h2h_weight,
                                  bias=param.h2h_bias,
                                  num_hidden=num_hidden * 4,
                                  name="t%d_l%d_h2h" % (seqidx, layeridx))
      gates = i2h + h2h
      slice_gates = mx.sym.SliceChannel(gates, num_outputs=4,
                                        name="t%d_l%d_slice" % (seqidx, layeridx))
      in_gate = mx.sym.Activation(slice_gates[0], act_type="sigmoid")
      in_transform = mx.sym.Activation(slice_gates[1], act_type="tanh")
      forget_gate = mx.sym.Activation(slice_gates[2], act_type="sigmoid")
      out_gate = mx.sym.Activation(slice_gates[3], act_type="sigmoid")
      next_c = (forget_gate * prev_state.c) + (in_gate * in_transform)
      next_h = out_gate * mx.sym.Activation(next_c, act_type="tanh")
      return LSTMState(c=next_c, h=next_h)
function_tokens: def lstm ( num_hidden , indata , prev_state , param , seqidx , layeridx , dropout = 0. ) : if dropout > 0. : indata = mx . sym . Dropout ( data = indata , p = dropout ) i2h = mx . sym . FullyConnected ( data = indata , weight = param . i2h_weight , bias = param . i2h_bias , num_hidden = num_hidden * 4 , name = "t%d_l%d_i2h" % ( seqidx , layeridx ) ) h2h = mx . sym . FullyConnected ( data = prev_state . h , weight = param . h2h_weight , bias = param . h2h_bias , num_hidden = num_hidden * 4 , name = "t%d_l%d_h2h" % ( seqidx , layeridx ) ) gates = i2h + h2h slice_gates = mx . sym . SliceChannel ( gates , num_outputs = 4 , name = "t%d_l%d_slice" % ( seqidx , layeridx ) ) in_gate = mx . sym . Activation ( slice_gates [ 0 ] , act_type = "sigmoid" ) in_transform = mx . sym . Activation ( slice_gates [ 1 ] , act_type = "tanh" ) forget_gate = mx . sym . Activation ( slice_gates [ 2 ] , act_type = "sigmoid" ) out_gate = mx . sym . Activation ( slice_gates [ 3 ] , act_type = "sigmoid" ) next_c = ( forget_gate * prev_state . c ) + ( in_gate * in_transform ) next_h = out_gate * mx . sym . Activation ( next_c , act_type = "tanh" ) return LSTMState ( c = next_c , h = next_h )