def slanted_triangular(max_rate, num_steps, cut_frac=<NUM_LIT:0.1>, ratio=<NUM_LIT:32>, decay=<NUM_LIT:1>, t=<NUM_LIT:0.0>):
cut = int(num_steps * cut_frac)<EOL>while True:<EOL><INDENT>t += <NUM_LIT:1><EOL>if t < cut:<EOL><INDENT>p = t / cut<EOL><DEDENT>else:<EOL><INDENT>p = <NUM_LIT:1> - ((t - cut) / (cut * (<NUM_LIT:1> / cut_frac - <NUM_LIT:1>)))<EOL><DEDENT>learn_rate = max_rate * (<NUM_LIT:1> + p * (ratio - <NUM_LIT:1>)) * (<NUM_LIT:1> / ratio)<EOL>yield learn_rate<EOL><DEDENT>
Yield an infinite series of values according to Howard and Ruder's
    "slanted triangular learning rate" schedule.