From 197adfd51ee1b9c970ea73fe9f76b5f3962a33a9 Mon Sep 17 00:00:00 2001 From: Daniele Grattarola Date: Thu, 1 Jun 2023 22:43:38 +0100 Subject: [PATCH] Format with latest Black version --- examples/graph_prediction/qm9_ecc.py | 1 + examples/other/node_clustering_tvgnn.py | 2 ++ spektral/layers/base.py | 2 -- spektral/layers/pooling/dmon_pool.py | 1 - spektral/layers/pooling/global_pool.py | 1 - 5 files changed, 3 insertions(+), 4 deletions(-) diff --git a/examples/graph_prediction/qm9_ecc.py b/examples/graph_prediction/qm9_ecc.py index 7c3822b7..864f2adc 100644 --- a/examples/graph_prediction/qm9_ecc.py +++ b/examples/graph_prediction/qm9_ecc.py @@ -40,6 +40,7 @@ loader_tr = DisjointLoader(dataset_tr, batch_size=batch_size, epochs=epochs) loader_te = DisjointLoader(dataset_te, batch_size=batch_size, epochs=1) + ################################################################################ # Build model ################################################################################ diff --git a/examples/other/node_clustering_tvgnn.py b/examples/other/node_clustering_tvgnn.py index 11ed8d1d..59ffdbaa 100644 --- a/examples/other/node_clustering_tvgnn.py +++ b/examples/other/node_clustering_tvgnn.py @@ -53,6 +53,7 @@ y = np.argmax(Y, axis=-1) n_clust = Y.shape[-1] + ################################ # MODEL ################################ @@ -101,6 +102,7 @@ def call(self, inputs): model = ClusteringModel(aggr=MP_layers, pool=pool_layer) opt = tf.keras.optimizers.Adam(learning_rate=learning_rate) + ################################ # TRAINING ################################ diff --git a/spektral/layers/base.py b/spektral/layers/base.py index 29ac48a7..19f6bef5 100644 --- a/spektral/layers/base.py +++ b/spektral/layers/base.py @@ -118,7 +118,6 @@ def __init__( kernel_constraint=None, **kwargs ): - super().__init__(**kwargs) self.trainable_kernel = trainable_kernel self.activation = activations.get(activation) @@ -184,7 +183,6 @@ class MinkowskiProduct(Layer): """ def __init__(self, activation=None, **kwargs): - super().__init__(**kwargs) self.activation = activations.get(activation) diff --git a/spektral/layers/pooling/dmon_pool.py b/spektral/layers/pooling/dmon_pool.py index 70f4baa8..5a7621c3 100644 --- a/spektral/layers/pooling/dmon_pool.py +++ b/spektral/layers/pooling/dmon_pool.py @@ -162,7 +162,6 @@ def reduce_index(self, i, s, **kwargs): return i_pool def modularity_loss(self, a, s, a_pool): - if K.is_sparse(a): n_edges = tf.cast(len(a.values), dtype=s.dtype) diff --git a/spektral/layers/pooling/global_pool.py b/spektral/layers/pooling/global_pool.py index f12ed430..5453df28 100644 --- a/spektral/layers/pooling/global_pool.py +++ b/spektral/layers/pooling/global_pool.py @@ -8,7 +8,6 @@ class GlobalPool(Layer): def __init__(self, **kwargs): - super().__init__(**kwargs) self.supports_masking = True self.pooling_op = None