-
-
Save Wapiti08/f917d46ef528e691604713dadb61d76a to your computer and use it in GitHub Desktop.
dgcnn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dgcnn = DeepGraphCNN( | |
layer_sizes = self.gcn_layers_size, | |
activations = ['tanh', 'tanh', 'tanh', 'tanh'], | |
k = self.gcn_nrows, | |
generator = generator, | |
bias=False, | |
) | |
# get the gnn out and gnn input | |
gnn_inp, gnn_out = dgcnn.in_out_tensors() | |
# buid cnn with gnn out as the input | |
x_out = Conv1D(filters=16, kernel_size=sum(self.gcn_layers_size), strides=sum(self.gcn_layers_size))(gnn_out) | |
x_out = MaxPool1D(pool_size=2)(x_out) | |
x_out = Conv1D(filters=32, kernel_size=5, strides=1)(x_out) | |
x_out = Flatten()(x_out) | |
x_out = Dense(128, activation='relu')(x_out) | |
x_out = Dropout(0.5)(x_out) | |
predictions = Dense(class_num, activation='softmax')(x_out) | |
model = Model(inputs=gnn_inp, outputs=predictions) | |
model.compile(optimizer=Adam(lr=0.001), loss=categorical_crossentropy, metrics=['accuracy']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment