October 2018
Intermediate to advanced
252 pages
6h 49m
English
The concatenate function is used to merge two models, as shown in the following code:
# merge feature extractorsmerge = concatenate([flat1, flat2])# interpretation layerhidden1 = Dense(512, activation='relu')(merge)
Here is the complete model topology code:
#input layervisible = Input(shape=(32,32,3))# first feature extractorconv1 = Conv2D(32, kernel_size=4, activation='relu')(visible)pool1 = MaxPooling2D(pool_size=(2, 2))(conv1)flat1 = Flatten()(pool1)# second feature extractorconv2 = Conv2D(16, kernel_size=8, activation='relu')(visible)pool2 = MaxPooling2D(pool_size=(2, 2))(conv2)flat2 = Flatten()(pool2)# merge feature extractorsmerge = concatenate([flat1, flat2])# interpretation layerhidden1 = Dense(512, activation='relu')(merge) ...
Read now
Unlock full access