Ola!
Estou estudando Redes neurais pelo livro do Jeff Heaton ,
estou estudando agora os Self Organizing Maps, e estou tentando classificar padroes numéricos…
[code]public static void main(String args[]) {
Logic logic = new Logic(null);
int sample_count = 3;
int inputCount = 6;
int outputCount = 3;
double[][] train = new double[sample_count][inputCount];
//First Sample will set the first outputNeuron
train[0][0] = 1;
train[0][1] = 2;
train[0][2] = 3;
train[0][3] = 4;
train[0][4] = 5;
train[0][5] = 6;
//Second Sample will set the 2nd outputNeuron
train[1][0] = 80;
train[1][1] = 90;
train[1][2] = 100;
train[1][3] = 110;
train[1][4] = 120;
train[1][5] = 130;
//Third Sample will set the 3rd outputNeuron
train[2][0] = 200;
train[2][1] = 210;
train[2][2] = 220;
train[2][3] = 230;
train[2][4] = 240;
train[2][5] = 250;
logic.normalizationType = NormalizeInput.NormalizationType.MULTIPLICATIVE;
logic.learningMethod = TrainSelfOrganizingMap.LearningMethod.ADDITIVE;
logic.start(inputCount, outputCount, logic.normalizationType, train, logic.learningMethod, logic.learnRate);
}
[/code]
Ou seja… Sempre que eu apresentasse um vetor igual a LINHA ZERO do train, ao input do som, o neuronio 0 de saida deveria ganhar.
E quando eu apresentasse um vetor igual a 1º LINHA do train, o neuronio 1 de saida deveria ganhar…E assim por diante, certo?
Mas parece que esta randomico…como posso mapear isto?O código esta correto?
E criei esse projeto :
https://bitbucket.org/andrelopes1705/biometry-som/src
Por enquanto, só estou usando esta 2 classes :
https://bitbucket.org/andrelopes1705/biometry-som/src/c58dfe887a3ef22ff406220e1d7e817543f9108f/core/src/br/lopes/biometrySom/logic/Logic.java?at=default
e as classes do Jeff Heaton como modelos.
A reposta dos Inputs sempre me devolvem Winners Diferentes em diferentes inicializações…Por que?
Por exemplo:
Rodei o Main 1ºVez
Input :1.0;2.0;3.0;4.0;5.0;6.0;
Winner : 2
ValueR : 0.10482848367219182
Input :80.0;90.0;100.0;110.0;120.0;130.0;
Winner : 1
ValueR : 0.30701182258133436
Input :200.0;210.0;220.0;230.0;240.0;250.0;
Winner : 0
ValueR : 0.36184651012597
////////////
Rodei o Main 2ºVez
Testing SOM!
Input :1.0;2.0;3.0;4.0;5.0;6.0;
Winner : 0
ValueR : 0.10482848367219182
Input :80.0;90.0;100.0;110.0;120.0;130.0;
Winner : 2
ValueR : 0.30701182258133436
Input :200.0;210.0;220.0;230.0;240.0;250.0;
Winner : 1
ValueR : 0.36184651012597
///////////
Rodei o Main 3ºVez
Input :1.0;2.0;3.0;4.0;5.0;6.0;
Winner : 1
ValueR : 0.10482848367219182
Input :80.0;90.0;100.0;110.0;120.0;130.0;
Winner : 0
ValueR : 0.30701182258133436
Input :200.0;210.0;220.0;230.0;240.0;250.0;
Winner : 2
ValueR : 0.36184651012597