def check_learns_zero_output_rnn(model, sgd, X, Y, initial_hidden=None):
outputs, get_dX = model.begin_update(X, initial_hidden)<EOL>Yh, h_n = outputs<EOL>tupleDy = (Yh - Y, h_n)<EOL>dX = get_dX(tupleDy, sgd=sgd)<EOL>prev = numpy.abs(Yh.sum())<EOL>print(prev)<EOL>for i in range(<NUM_LIT:1000>):<EOL><INDENT>outputs, get_dX = model.begin_update(X)<EOL>Yh, h_n = outputs<EOL>current_sum = numpy.abs(Yh.sum())<EOL>tupleDy = (Yh - Y, h_n)<EOL>dX = get_dX(tupleDy, sgd=sgd)  <EOL><DEDENT>print(current_sum)<EOL>
Check we can learn to output a zero vector