Content deleted Content added
No edit summary |
No edit summary |
||
Line 1:
In [[
{{Citation
| last1 = Karray | first1 = Fakhreddine O.
Line 6:
| date = 2004
| publisher = Addison Wesley
| isbn = 0-321-11617-8}}</ref>
| last1 = Baluja | first1 = Shumeet
| title = Population-Based Incremental Learning: A Method for Integrating Genetic Search Based Function Optimization and Competitive Learning
Line 20:
| pages = 38-46
}}</ref>.
==
In PBIL, genes are represented as real values in the range [0,1], indicating the probability that any particular [[allele]] appears in that [[gene]].
The PBIL algorithm is as follows:
Line 34 ⟶ 32:
== Source code ==
This is a part of source code implemented in [[Java]]. In the paper, learnRate = 0.1, negLearnRate = 0.075, mutProb = 0.02, and mutShift = 0.05 is used. N = 100 and ITER_COUNT = 1000 is enough for a small problem.
<source lang="java">
Line 43 ⟶ 41:
bestCost = POSITIVE_INFINITY;
for (int i = 0; i <
// Creates N
boolean[][]
for (boolean[]
for (int k = 0; k <
if (rand.nextDouble() < probVec[k])
}
}
Line 56 ⟶ 54:
double[] costs = new double[N];
for (int j = 0; j < N; j++) {
costs[j] = costFunc.cost(toRealVec(
}
// Find min and max cost
boolean[]
double minCost = POSITIVE_INFINITY, maxCost = NEGATIVE_INFINITY;
for (int j = 0; j < N; j++) {
Line 66 ⟶ 64:
if (minCost > cost) {
minCost = cost;
}
if (maxCost < cost) {
maxCost = cost;
}
}
// Compare with the best cost
if (bestCost > minCost) {
bestCost = minCost;
}
// Update the probability vector with max and min cost
for (int j = 0; j < totalBits; j++) {
if (
probVec[j] = probVec[j] * (1d - learnRate) +
(
} else {
final double learnRate2 = learnRate + negLearnRate;
probVec[j] = probVec[j] * (1d - learnRate2) +
(
}
}
Line 104 ⟶ 102:
==See also==
* [[Estimation of Distribution Algorithm]] (EDA)
== References ==
|