From b2daadb463218364af6b69153880a301496855e5 Mon Sep 17 00:00:00 2001 From: Felix Maurin Date: Tue, 17 Dec 2019 11:46:20 +0100 Subject: [PATCH] 'modif perceptron' --- learning/code/PMC_training.m | 8 ++++---- learning/code/learning.m | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/learning/code/PMC_training.m b/learning/code/PMC_training.m index 699aecb..5175dfb 100644 --- a/learning/code/PMC_training.m +++ b/learning/code/PMC_training.m @@ -1,4 +1,4 @@ -function [net, rt, errort, perft] = PMC_training(entree, sortie, n_cache, nb_apprentissage) +function [net, rt] = PMC_training(entree, sortie, n_cache, nb_apprentissage) [n_entree, nb_echantillons] = size(entree); [n_sortie, ~] = size(sortie); @@ -22,8 +22,8 @@ net.divideParam.testRatio = (nb_echantillons - nb_apprentissage) / nb_echantillo net = train(net, entree, sortie); -entree_test = entree((nb_apprentissage + 1): nb_echantillons,:); -sortie_test = sortie((nb_apprentissage + 1): nb_echantillons,:); -[rt, pf, af, errort, perft] = sim(net, entree_test, [], [], sortie_test); +entree_test = entree(:,(nb_apprentissage + 1): nb_echantillons); +sortie_test = sortie(:,(nb_apprentissage + 1): nb_echantillons); +rt = sim(net, entree_test, [], [], sortie_test); end diff --git a/learning/code/learning.m b/learning/code/learning.m index 41b853f..8bac4f0 100644 --- a/learning/code/learning.m +++ b/learning/code/learning.m @@ -78,6 +78,8 @@ end % utilisation de l'algorithme du perceptron multicouches -[net, resultats_test, ecarts, erreur] = PMC_training(vecteurs, classes, 10, 900); +[net, resultats_test] = PMC_training(vecteurs, classes, 10, 800); + +%faire une prediction : y = net(x)