'maps the optimizers to their corresponding layers'

def _map_optimizers(self, layer_list):

    map_list = dict()
    for layer in layer_list:
        classname = layer.__class__.__name__
        name = layer.name
        opt = None
        if (name in self.optimizer_mapping):
            opt = self.optimizer_mapping[name]
        elif (classname in self.optimizer_mapping):
            opt = self.optimizer_mapping[classname]
        else:
            opt = self.optimizer_mapping['default']
        if (opt not in map_list):
            map_list[opt] = [layer]
        else:
            map_list[opt].append(layer)
    return map_list
