运行这个深度谱聚类网络的python程序 不报错也不停止啊 求大神指教~

本文主要讨论了一个关于深度谱聚类网络的Python程序在运行时遇到的问题,程序不报错但也不停止。作者展示了代码片段,并寻求社区帮助解决运行不出来的问题。代码中包含了数据预处理、模型定义以及相关算法实现。
摘要由CSDN通过智能技术生成

运行这个深度谱聚类网络的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_
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值