self.gui_plot(int(ite/validate_interval),feat,np.asarray(l_list)[1:],np.asarray(average_dis),distribution,colors=y,prefix=prefix)# plot the data with label colors
ifbool(self.verbose)>0:
c=np.arange(classes.shape[0])[invers_counts]
acc=np.round(accuracy_score(y,c),5)# accuracy
nmi=np.round(normalized_mutual_info_score(y,c),5)# normalized mutual information
ari=np.round(adjusted_rand_score(y,c),5)#
print('Iter %d: of %d acc=%.5f, nmi=%.5f, loss=%.5f, dis_avg=%.5f'%(ite,self.steps,acc,nmi,l_list[-1],average_dis[-1]))# print into console , specific statistics
logdict=dict(iter=ite,acc=acc,nmi=nmi,loss=l_list[-1],dis_avg=average_dis[-1])# log it into logfile.
logwriter.writerow(logdict)# write row
logfile.flush()# flush into file to avoid memory consumption
else:
print('Iter %d: of %d ,loss=%.5f, dis_avg=%.5f'%(ite,self.steps,l_list[-1],average_dis[-1]))# print information
logdict=dict(iter=ite,loss=l_list[-1],dis_avg=average_dis[-1])# log it into logfile.
self.gui_plot(int(ite/validate_interval),view_models,np.asarray(d_list)[1:],np.asarray(l_list)[1:],models,prefix=prefix)# plot the data with label colors
print('Iter %d: of %d loss_generator=%.5f, loss_descriminator=%.5f'%(ite,self.steps))# print into console , specific statistics
logdict=dict(iter=ite,loss=l_list[-1])# log it into logfile.
logwriter.writerow(logdict)# write row
logfile.flush()# flush into file to avoid memory consumption