coremltools/converters/keras/_topology.py [57:93]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
class NetGraph(object):
    """
    Attributes:
    layer_list - a list of layer names in the Keras model
    connection_map - a map where the key is a layer, the value is a list of its successors
    reverse_connection_map - a map where the key is a layer, the value is a list of its predecessors
    keras_layer_map - a map where the key is a layer name, the value is Keras layer
    model - a reference of the keras model.
    blob_names - blob names for each one of the edge.
    """

    def __init__(self, model):
        self.layer_list = []
        self.edge_map = {}
        self.reverse_edge_map = {}
        self.keras_layer_map = {}

        self.input_layers = []
        self.output_layers = []
        self.layers_inputs = {}  # each layer's input blobs
        self.layers_outputs = {}  # each layer's output blobs

        # these will be pairs of the form (name, shape) because it'll show up on the interface
        self.optional_inputs = []
        self.optional_outputs = []
        self.layers_optional_inputs = {}
        self.layers_optional_outputs = {}

        self.model = model

    def _add_layer(self, keras_layer):
        # add a layer without adding connections.
        # when a layer exist alreday, this operation won't do anything
        layer = keras_layer.name
        if layer not in self.layer_list:
            self.layer_list.append(layer)
            self.keras_layer_map[layer] = keras_layer
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



coremltools/converters/keras/_topology2.py [79:115]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
class NetGraph(object):
    """
    Attributes:
    layer_list - a list of layer names in the Keras model
    connection_map - a map where the key is a layer, the value is a list of its successors
    reverse_connection_map - a map where the key is a layer, the value is a list of its predecessors
    keras_layer_map - a map where the key is a layer name, the value is Keras layer
    model - a reference of the keras model.
    blob_names - blob names for each one of the edge.
    """

    def __init__(self, model):
        self.layer_list = []
        self.edge_map = {}
        self.reverse_edge_map = {}
        self.keras_layer_map = {}

        self.input_layers = []
        self.output_layers = []
        self.layers_inputs = {}  # each layer's input blobs
        self.layers_outputs = {}  # each layer's output blobs

        # these will be pairs of the form (name, shape) because it'll show up on the interface
        self.optional_inputs = []
        self.optional_outputs = []
        self.layers_optional_inputs = {}
        self.layers_optional_outputs = {}

        self.model = model

    def _add_layer(self, keras_layer):
        # add a layer without adding connections.
        # when a layer exist alreday, this operation won't do anything
        layer = keras_layer.name
        if layer not in self.layer_list:
            self.layer_list.append(layer)
            self.keras_layer_map[layer] = keras_layer
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



