code: def create_network_with_one_subnet():
      # FROM https://stackoverflow.com/questions/54648296/how-to-flatten-a-nested-model-keras-functional-api/54648506
      # define subnetwork
      subnet = keras.models.Sequential(name="subnet")
      subnet.add(keras.layers.Conv2D(6, (3, 3), padding="same"))
      subnet.add(keras.layers.MaxPool2D())
      subnet.add(keras.layers.Conv2D(12, (3, 3), padding="same"))
      subnet.add(keras.layers.MaxPool2D())
      # subnet.summary()
  
      # define complete network
      input_shape = (32, 32, 1)
      net_in = keras.layers.Input(shape=input_shape)
      net_out = subnet(net_in)
      net_out = keras.layers.Flatten()(net_out)
      net_out = keras.layers.Dense(1)(net_out)
      net_complete = keras.Model(inputs=net_in, outputs=net_out)
      net_complete.compile(
          loss="binary_crossentropy",
          optimizer=keras.optimizers.Adam(lr=0.001),
          metrics=["acc"],
      )
      net_complete.summary()
      # plot_model(net_complete)
      return net_complete
  
imports: import unittest
  import numpy
  import tensorflow
  import tensorflow.keras.backend
  from tensorflow import keras
  from tensorflow.keras import Model, Input
  from tensorflow.keras.layers import Add
  from tensorflow.keras.layers import ReLU, concatenate
  from tensorflow.keras.layers import TimeDistributed, Dense, Embedding, LSTM
  from keract import get_activations, get_gradients_of_activations, get_gradients_of_trainable_weights, keract
label_desc: Use image node_id 1 for calling a global function with example usage: create_network_with_one_subnet() and returns: net_complete