'Gets the learning rate given the index of the weight.
Parameters
index : int
The index corresponding to the weight.
Returns
lr : float
Learning rate for this index.'

def _get_lr(self, index):

    if (self.lr_scheduler is not None):
        lr = self.lr_scheduler(self.num_update)
    else:
        lr = self.lr
    if (index in self.param_dict):
        lr *= self.param_dict[index].lr_mult
    elif (index in self.lr_mult):
        lr *= self.lr_mult[index]
    elif (index in self.idx2name):
        lr *= self.lr_mult.get(self.idx2name[index], 1.0)
    return lr
