A graph represents a model whose layers do not form one straight chain. Nodes and connections capture multiple inputs, multiple outputs, branches, merges, and other nonlinear topologies. section 7.2.2
Ticket-priority and routing model
Three inputs—ticket title, body, and tags—merge through Concatenate into shared features. Those features then branch into priority and department outputs, forming a multi-input, multi-output graph. section 7.2.2
Use the graph view to:
- Connect layers by calling them on symbolic tensors, which carry shape and dtype specifications without containing actual data. section 7.2.2
- Inspect layer inputs and outputs to understand how branches and merges are wired. section 7.2.2
- Plot the model with layer names and shape information when checking its topology. section 7.2.2
Listing 7.9 A multi-input, multi-output Functional model
vocabulary_size = 10000 num_tags = 100 num_departments = 4 title = keras.Input(shape=(vocabulary_size,), name="title") #1 text_body = keras.Input(shape=(vocabulary_size,), name="text_body") #1 tags = keras.Input(shape=(num_tags,), name="tags") #1 features = layers.Concatenate()([title, text_body, tags]) #2 features = layers.Dense(64, activation="relu", name="dense_features")(features) #3 priority = layers.Dense(1, activation="sigmoid", name="priority")(features)#4 department = layers.Dense( #4 num_departments, activation="softmax", name="department" #4 )(features) #4 #5 model = keras.Model( #5 inputs=[title, text_body, tags], #5 outputs=[priority, department], #5 ) #5
Browse a concrete graph with three inputs, a merged feature path, and two output branches. section 7.2.2




















