Ce serveur Gitlab sera éteint le 30 juin 2020, pensez à migrer vos projets vers les serveurs gitlab-research.centralesupelec.fr et gitlab-student.centralesupelec.fr !

Commit 64b49cd1 authored by Ngocson's avatar Ngocson

param

parent 4b61daba
No preview for this file type
......@@ -59,15 +59,17 @@ LDAWineDataset = (WineTrainDataLDA,WineTrainLabel,WineTestDataLDA,WineTestLabel,
WineDatasets = (WineDataset,PCAWineDataset,ICAWineDataset,RPWineDataset,LDAWineDataset)
N = 30
N = 10
te_scores = []
tr_scores = []
for dataset in MNISTdatasets:
te_score = []
tr_score = []
trainData,trainLabel,testData,testLabel,name,Nc = dataset
print(name)
for n in range(N):
trainData,trainLabel,testData,testLabel,name,Nc = dataset
#MNIST
......@@ -103,8 +105,10 @@ for dataset in MNISTdatasets:
for dataset in WineDatasets:
te_score = []
tr_score = []
trainData,trainLabel,testData,testLabel,name,Nc = dataset
print(name)
for n in range(N):
trainData,trainLabel,testData,testLabel,name,Nc = dataset
#MNIST
......
RESULTS/RPMNISTerror.png

20.3 KB | W: | H:

RESULTS/RPMNISTerror.png

34.3 KB | W: | H:

RESULTS/RPMNISTerror.png
RESULTS/RPMNISTerror.png
RESULTS/RPMNISTerror.png
RESULTS/RPMNISTerror.png
  • 2-up
  • Swipe
  • Onion skin
RESULTS/RPWineerror.png

22.3 KB | W: | H:

RESULTS/RPWineerror.png

26.5 KB | W: | H:

RESULTS/RPWineerror.png
RESULTS/RPWineerror.png
RESULTS/RPWineerror.png
RESULTS/RPWineerror.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -24,14 +24,14 @@ datasets = [("MNIST",MNISTtestData,MNISTtrainData,MNISTtestLabel,MNISTtrainLabel
transformedDatasets = []
name,testData, trainData,testLabel,trainLabel = datasets[1]
name,testData, trainData,testLabel,trainLabel = datasets[0]
print("Step 2: \nFeature reduction:")
N = 30
N = 500
te_totscores = np.zeros(N-1).astype(np.float)
tr_totscores = np.zeros(N-1).astype(np.float)
for j in range(50):
for j in range(1):
te_scores = []
tr_scores = []
......@@ -45,14 +45,14 @@ for j in range(50):
X_ = np.matrix(Y)*np.matrix(rp.components_)
te_score = np.linalg.norm(X-X_)/np.linalg.norm(X)
te_score = np.linalg.norm(X-X_)/np.linalg.norm(X_)
te_scores.append(te_score)
X = trainData
Y = rp.transform(X)
X_ = np.matrix(Y)*np.matrix(rp.components_)
tr_score = np.linalg.norm(X-X_)/np.linalg.norm(X)
tr_score = np.linalg.norm(X-X_)/np.linalg.norm(X_)
tr_scores.append(tr_score)
te_totscores += np.array(te_scores)
tr_totscores += np.array(tr_scores)
......@@ -60,7 +60,7 @@ for j in range(50):
plt.figure()
plt.plot(range(1,N),te_totscores/50,'r.-',label = "error on the test")
plt.plot(range(1,N),tr_totscores/50,'b.-',label = "error on the train")
plt.title("ICA error")
plt.title("RP error on "+name)
plt.legend()
plt.savefig("RESULTS/RP"+name+"error.png")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment