	clear;
   load training0.mat;
   load testing0.mat; 
   filename='c:\temp\selforgData\results0.log';
   
   eps=10^(-9);
   %	scale training data
	[Scaled_Training_data]=scale_data(Training_data);
   %	set number of neurons per layer to input dimensionality 
   NNeurons_per_layer=size(Training_data,1);
   Ninputs=NNeurons_per_layer;
   %	set probability of remote connection
   prr=.4;
   %	set probability of subspace partititon
   psp=.5;
   %	set number of classes
   ncl=max(Class_index_training);
   %	set number of layers
   Nlayers=ceil(1/psp*log2(ncl)+1/prr*log2(NNeurons_per_layer));
   %	number of nearest neighbors
   nnb=1;
   %	number of next nearest neighbors
   nnnb=2;
   %	number of remote neighbors
   nrnb=2;
   %	number of clock controlled inputs
   ncci=2;
   %	subspace selection probability
   ssp=0.3;
   %	threshold of the information deficiency for learning
   tid=0.1;
   %	information deficiency threshold for the voting neurons
   voting_t=0.9;
   %	nuber of bits
   nb=8;
   %	organize NN
   [ neurons topology cpu_time ] = selforgNN( ... 
      Scaled_Training_data, Class_index_training, NNeurons_per_layer, ...
      Nlayers, nnb, nnnb, nrnb, ncci, ssp, tid, voting_t, nb)
   %	plot the resultning NN structure
   %plot_learned_structure(Nlayers,Nlayers,NNeurons_per_layer,Ninputs,neurons)
   
   %	test classification results for training data
   %	NN self_organization classification results
   [ sonno_class_probabilities_train, votes_train, ...
         classification_train, confusion_train, correct_train, declare_train ] = ... 
      	NNorgVote( neurons, Nlayers, NNeurons_per_layer, topology, ... 
            Scaled_Training_data, Class_index_training, nb, ncl);
         %%	for debuging only
    %dpyAllNNInfo(neurons, filename, confusion_train, correct_train, declare_train, [],[],[]);
      
   %	test classification results for test data
   %	scale testing data
   [Scaled_Testing_data]=scale_data(Testing_data);   
   %	NN self_organization classification results
   [ sonno_class_probabilities_test, votes_test, ...
         classification_test, confusion_test, correct_test, declare_test] = ... 
      	NNorgVote( neurons, Nlayers, NNeurons_per_layer, topology, ... 
      	Scaled_Testing_data, Class_index_testing, nb, ncl);
      
   %	write neuron network information into a file
   dpyAllNNInfo(neurons, filename, confusion_train, correct_train, declare_train, ...
      confusion_test, correct_test, declare_test);
   
