运行这个深度谱聚类网络的python程序 不报错也不停止啊 求大神指教~
from future import division, print_function, absolute_import
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
from tensorflow.contrib import layers
from sklearn import cluster
from munkres import Munkres
import scipy.io as sio
from scipy.sparse.linalg import svds
from sklearn.preprocessing import normalize
from tensorflow.examples.tutorials.mnist import input_data
class ConvAE(object):
def init(self, n_input, kernel_size, n_hidden, reg_const1 = 1.0, reg_const2 = 1.0, reg = None, batch_size = 256,
# denoise = False, model_path = None, logs_path = ‘/home/pan/workspace-eclipse/deep-subspace-clustering/COIL20CodeModel/new/pretrain/logs’):
denoise = False, model_path = None, logs_path = ‘./logs/COIL20-logs’):
#n_hidden is a arrary contains the number of neurals on every layer
self.n_input = n_input
self.n_hidden = n_hidden
self.reg = reg
self.model_path = model_path
self.kernel_size = kernel_size
self.iter = 0
self.batch_size = batch_size
weights = self._initialize_weights()
# model
self.x = tf.placeholder(tf.float32, [None, self.n_input[0], self.n_input[1], 1])
self.learning_rate = tf.placeholder(tf.float32, [])
if denoise == False:
x_input = self.x
latent, shape = self.encoder(x_input, weights)
else:
x_input = tf.add(self.x, tf.random_normal(shape=tf.shape(self.x),
mean = 0,
stddev = 0.2,
dtype=tf.float32))
latent,shape = self.encoder(x_input, weights)
self.z_conv = tf.reshape(latent,[batch_size, -1])
self.z_ssc, Coef = self.selfexpressive_moduel(batch_size)
self.Coef = Coef
latent_de_ft = tf.reshape(self.z_ssc, tf.shape(latent))
self.x_r_ft = self.decoder(latent_de_ft, weights, shape)
self.saver = tf.train.Saver([v for v in tf.trainable_variables() if not (v.name.startswith("Coef"))])
self.cost_ssc = 0.5*tf.reduce_sum(tf.pow(tf.subtract(self.z_conv,self.z_ssc), 2))
self.recon_ssc = tf.reduce_sum(tf.pow(tf.subtract(self.x_