def main(): # モデルの読み込み model = MODEL.L.Classifier(MODEL.CIFAR10_cifer()) chainer.serializers.load_npz("model_final", model) # データの読み込み images, labels = chainer.datasets.get_cifar10()[1]._datasets # table 作成 create_AE_file('AE.h5', model, images, labels, r=0.001, n_threads=32) # 評価 df = evaluate_AE('AE.h5', model, epsilon=0.01, n_threads=32) # 書き出し df.to_csv('AE.csv')
import chainer from chainer import cuda, Function, gradient_check, report, training, utils, Variable from chainer import datasets, iterators, optimizers, serializers from chainer import Link, Chain, ChainList import chainer.functions as F import chainer.links as L from chainer.training import extensions import matplotlib.pyplot as plt import cv2 import pandas as pd import MODEL #CIFAR10_cifer() from skimage import io #モデルの読み込み model = MODEL.L.Classifier(MODEL.CIFAR10_cifer()) serializers.load_npz("model_final", model) def Print_Label(num): label = [ 'airplane', 'automobile', 'bird', 'cat', 'deer', 'dog', 'frog', 'horse', 'ship', 'truck' ] #print("Label->{}".format(label[num])) return label[num] #ニューロンを一覧で表示する def MELMEL(data, num=10): #print("number : neuron")