def check_learns_zero_output(model, sgd, X, Y):
Yh, get_dX = model.begin_update(X)<EOL>dYh = (Yh - Y) / Yh.shape[<NUM_LIT:0>]<EOL>dX = get_dX(dYh, sgd=sgd)<EOL>prev = numpy.abs(Yh.sum())<EOL>for i in range(<NUM_LIT:100>):<EOL><INDENT>Yh, get_dX = model.begin_update(X)<EOL>total = numpy.abs(Yh.sum())<EOL>dX = get_dX(Yh - Y, sgd=sgd)  <EOL>assert total < prev<EOL>prev = total<EOL><DEDENT>
Check we can learn to output a zero vector