'Determine which optimizer in the container should go with which layers,
then apply their optimize functions to those layers.
Notes:
We can recalculate ``map_list`` in case ``optimizer_mapping`` changes
during training.'

def optimize(self, layer_list, epoch):

    if (not (id(layer_list) in self.map_list_cache)):
        self.map_list = self._map_optimizers(layer_list)
        self.map_list_cache[id(layer_list)] = self.map_list
    else:
        self.map_list = self.map_list_cache[id(layer_list)]
    for opt in self.map_list:
        opt.optimize(self.map_list[opt], epoch)
