public class RbfnPopulation
extends java.lang.Object
Implements a population of Radial basis Function Neural Networks to be evolved with EvRBFN_CL.
Constructor and Description |
---|
RbfnPopulation(int _size)
Creates a new instance of RbfnPopulation
|
RbfnPopulation(int _size,
double[][] _X,
int _ndatos,
int _nEnt,
int _nSal,
double _neuronsPercentage)
Creates and initializes a population using a set of data.
|
Modifier and Type | Method and Description |
---|---|
void |
adder(Rbfn _net)
Performs the DELETER mutator operator: modifies C_DELETER% of the Radius of the net
|
void |
applyOperators(double _xOverRate,
double _mutatorRate)
Applies operator according to their probabilities
|
void |
c_random(Rbfn _net)
Performs the C_RANDOM mutator operator: modifies MUTATORS_INTERNAL_PROB % of the centers of the net
|
void |
deleter(Rbfn _net)
Performs the DELETER mutator operator: modifies C_DELETER% of the Radius of the net
|
Rbfn |
individual(int _num)
Returns the _num-th individuals
|
void |
paint_sort(int _size)
Shows the _size first individuals (sorted by fitness)
|
void |
paint()
Prints the ppulation on a stdout
|
void |
paint(java.lang.String _fileName)
Prints the pipulation on a file.
|
void |
r_random(Rbfn _net)
Performs the R_RANDOM mutator operator: modifies 50% of the Radius of the net
|
void |
replaceIndividuals(int _numIndividuals)
Removes worse _numIndividuals nets from Population and includes individuals from subpopulation
|
void |
selectIndividuals(int _subPopSize,
int _tournamentSize)
Creates a subPopulation of individuals using the tournament method.
|
void |
set_min_max_values(double[][] _X,
int _ndatos,
int _nEnt)
Setting the mix and max values for data (needed for operators)
|
void |
setFitness_Cl_subPop(double[][] _X,
double[][] _Y,
int _nDatos,
int _nClases)
Sets the fitness of a Sub-Population of RBFNs for classification problems
|
void |
setFitness_Cl(double[][] _X,
double[][] _Y,
int _nDatos,
int _nClases)
Sets the fitness of a Population of RBFNs for classification problems
|
void |
sort_population()
Sorts population
|
void |
trainLMS_subPop(double[][] _X,
double[][] _Y,
int _nDatos,
int _LMSLoops,
double _delta)
Trains a Population of RBFNs
|
void |
trainLMS(double[][] _X,
double[][] _Y,
int _nDatos,
int _LMSLoops,
double _delta)
Trains a Population of RBFNs
|
void |
x_fix(Rbfn _net)
Performs the X_FIX crossover operator: replaces numNeurons neurons from
_net, taking numNeurons from a randomly chosen net.
|
public RbfnPopulation(int _size)
Creates a new instance of RbfnPopulation
_size
- Size of populationpublic RbfnPopulation(int _size, double[][] _X, int _ndatos, int _nEnt, int _nSal, double _neuronsPercentage)
Creates and initializes a population using a set of data.
_size
- Number of nets in the population_X
- Set of input patterns_ndatos
- Number of input patterns_nEnt
- Dimension of input space_nSal
- Dimension of output space_neuronsPercentage
- Percentage of _ndatos used as upper boundary for the number of neuronspublic void set_min_max_values(double[][] _X, int _ndatos, int _nEnt)
Setting the mix and max values for data (needed for operators)
_X
- Data_ndatos
- Number of data (could differ from _X.length)_nEnt
- Input dimensionpublic void trainLMS(double[][] _X, double[][] _Y, int _nDatos, int _LMSLoops, double _delta)
Trains a Population of RBFNs
_X
- Set ot input patterns_Y
- Set of output values_nDatos
- Number of patterns in _X_LMSLoops
- NUmber of iterations for LMS_delta
- Delta parameter for LMSpublic void setFitness_Cl(double[][] _X, double[][] _Y, int _nDatos, int _nClases)
Sets the fitness of a Population of RBFNs for classification problems
_X
- array containing the input patterns_Y
- array containing the desired output (although only first column is used)_nDatos
- Number of patterns_nClases
- Number of diferent classespublic void trainLMS_subPop(double[][] _X, double[][] _Y, int _nDatos, int _LMSLoops, double _delta)
Trains a Population of RBFNs
_X
- Set ot input patterns_Y
- Set of output values_nDatos
- Number of patterns in _X_LMSLoops
- NUmber of iterations for LMS_delta
- Delta parameter for LMSpublic void setFitness_Cl_subPop(double[][] _X, double[][] _Y, int _nDatos, int _nClases)
Sets the fitness of a Sub-Population of RBFNs for classification problems
_X
- array containing the input patterns_Y
- array containing the desired output (although only first column is used)_nDatos
- Number of patterns_nClases
- Number of diferent classespublic void selectIndividuals(int _subPopSize, int _tournamentSize)
Creates a subPopulation of individuals using the tournament method.
_subPopSize
- Number of individuals to select_tournamentSize
- Number of individuals to perform the tournamentpublic void applyOperators(double _xOverRate, double _mutatorRate)
Applies operator according to their probabilities
_xOverRate
- Probability for XOver operators_mutatorRate
- Probability for Mutation operatorspublic void replaceIndividuals(int _numIndividuals)
Removes worse _numIndividuals nets from Population and includes individuals from subpopulation
_numIndividuals
- Number of indivuals to replacepublic void paint_sort(int _size)
Shows the _size first individuals (sorted by fitness)
_size
- Number of individuals to showpublic void sort_population()
Sorts population
public void x_fix(Rbfn _net)
Performs the X_FIX crossover operator: replaces numNeurons neurons from _net, taking numNeurons from a randomly chosen net.
_net
- The net to be modifiedpublic void c_random(Rbfn _net)
Performs the C_RANDOM mutator operator: modifies MUTATORS_INTERNAL_PROB % of the centers of the net
_net
- The net to be modifiedpublic void r_random(Rbfn _net)
Performs the R_RANDOM mutator operator: modifies 50% of the Radius of the net
_net
- The net to be modifiedpublic void deleter(Rbfn _net)
Performs the DELETER mutator operator: modifies C_DELETER% of the Radius of the net
_net
- The net to be modifiedpublic void adder(Rbfn _net)
Performs the DELETER mutator operator: modifies C_DELETER% of the Radius of the net
_net
- The net to be modifiedpublic void paint()
Prints the ppulation on a stdout
public void paint(java.lang.String _fileName)
Prints the pipulation on a file.
_fileName
- Name of the file.public Rbfn individual(int _num)
Returns the _num-th individuals
_num
- Position of the individual to return