Closed wagpa closed 1 year ago
args = Map(
batch_size = 64,
epochs = 10,
random_seed = None,
graph_size = 20,
graph_average_degree = 5,
layers = 3,
layer_size = 16
)
With accuracy: 0.7900
args = Map( batch_size = 64, epochs = 100, random_seed = None, graph_size = 100, graph_average_degree = 10, layers = 3, layer_size = 16 )
accuracy: 0.9911
Test 1 and 2 used the following code to generate the predicted graph
pred_graph = nx.create_empty_copy(nx_graph, with_data=True)
pairs = [ (x, y) for x in range(nx_graph.number_of_nodes()) for y in range(nx_graph.number_of_nodes()) ]
predictions = probability_model.predict([[nodes[pair[0]]['pos'][0], nodes[pair[0]]['pos'][1], nodes[pair[1]]['pos'][0], nodes[pair[1]]['pos'][1]] for pair in pairs ])
#predictions = probability_model.predict([np.append((nodes[pair[0]]['pos']), (nodes[pair[1]]['pos'])) for pair in pairs ])
edges = [ pair for pair, prediction in zip(pairs, predictions) if prediction[0] ]
pred_graph.add_edges_from(edges)
nx.draw(pred_graph, pos, node_size=10)
The above hidden tests 1 and 2 used an badly chosen prob model. With a better one: (e027c732ee9c6c459747416feb9a62aeacae7beb)
loss: 0.0409 - accuracy: 0.9848 - recall_16: 1.0000 - auc_13: 0.9990
Where from blue to red means higher prediction. Prediction means here probHasConnection - probHasNoConnection
where positive.
colors = np.array([ (prediction[0] - prediction[1], 1 - (prediction[0] - prediction[1]), 1) for prediction in predictions if (prediction[0] >= prediction[1]) ])
With same code as above
loss: 0.0108 - accuracy: 0.9956 - recall_17: 1.0000 - auc_14: 0.9999
Without loops
loss: 0.0070 - accuracy: 0.9968 - recall_4: 1.0000 - auc_4: 0.9240
Use to check, that model does nothing funny like always saying, that points are not connected.