def rate(epoch, rate_init, epochs_per_order):
    """ Computes learning rate as a function of epoch index.
        Inputs:
        epoch - Index of current epoch.
        rate_init - Initial rate.
        epochs_per_order - Number of epochs to drop an order of magnitude.
    """
    return rate_init * 10.0 ** (-epoch / epochs_per_order)