From 026fa1f109e8c6ad6393d768bcf88cb89784bbec Mon Sep 17 00:00:00 2001 From: Emilio Manzotti Date: Thu, 23 Jun 2022 12:49:38 +0200 Subject: [PATCH] fixed some bugs --- DCEC.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DCEC.py b/DCEC.py index 3f194ad..d0ece22 100644 --- a/DCEC.py +++ b/DCEC.py @@ -1,7 +1,7 @@ from time import time import numpy as np import keras.backend as K -from keras.engine.topology import Layer, InputSpec +from keras.layers import Layer, InputSpec from keras.models import Model from keras.utils.vis_utils import plot_model from sklearn.cluster import KMeans @@ -41,7 +41,7 @@ def build(self, input_shape): assert len(input_shape) == 2 input_dim = input_shape[1] self.input_spec = InputSpec(dtype=K.floatx(), shape=(None, input_dim)) - self.clusters = self.add_weight((self.n_clusters, input_dim), initializer='glorot_uniform', name='clusters') + self.clusters = self.add_weight(shape=(self.n_clusters, input_dim), initializer='glorot_uniform', name='clusters') if self.initial_weights is not None: self.set_weights(self.initial_weights) del self.initial_weights