From 3c83538398d9c0b22804bbaf876c7e51554fb1e8 Mon Sep 17 00:00:00 2001
From: Jason Brownlee
-This section presents a brief review of Holland's adaptive systems formalism described in [Holland1975] (Chapter 2). This presentation focuses particularly on the terms and their description, and has been hybridized with the concise presentation of the formalism by De Jong [Jong1975] (page 6). The formalism is divided into sections: 1) Primary Objects summarized in Table (below), and 2) Secondary Objects summarized in Table (below). Primary Objects are the conventional objects of an adaptive system: the environment $["e"]$, the strategy or adaptive plan that creates solutions in the environment $["s"]$, and the utility assigned to created solutions $["U"]$.
+This section presents a brief review of Holland's adaptive systems formalism described in [Holland1975] (Chapter 2). This presentation focuses particularly on the terms and their description, and has been hybridized with the concise presentation of the formalism by De Jong [Jong1975] (page 6). The formalism is divided into sections: 1) Primary Objects summarized in Table (below), and 2) Secondary Objects summarized in Table (below). Primary Objects are the conventional objects of an adaptive system: the environment $e$, the strategy or adaptive plan that creates solutions in the environment $s$, and the utility assigned to created solutions $U$.
-Secondary Objects extend beyond the primary objects providing the detail of the formalism. These objects suggest a broader context than that of the instance specific primary objects, permitting the evaluation and comparison of sets of objects such as plans ($["S"]$), environments ($["E"]$), search spaces ($["A"]$), and operators ($["O"]$).
+Secondary Objects extend beyond the primary objects providing the detail of the formalism. These objects suggest a broader context than that of the instance specific primary objects, permitting the evaluation and comparison of sets of objects such as plans ($S$), environments ($E$), search spaces ($A$), and operators ($O$).
-A given adaptive plan acts in discrete time $["t"]$, which is a useful simplification for analysis and computer simulation. A framework for a given adaptive system requires the definition of a set of strategies $["S"]$, a set of environments $["E"]$, and criterion for ranking strategies $["X"]$. A given adaptive plan is specified within this framework given the following set of objects: a search space $["A"]$, a set of operators $["O"]$, and feedback from the environment $["I"]$. Holland proposed a series of fundamental questions when considering the definition for an adaptive system, which he rephrases within the context of the formalism (see Table (below)).
+A given adaptive plan acts in discrete time $t$, which is a useful simplification for analysis and computer simulation. A framework for a given adaptive system requires the definition of a set of strategies $S$, a set of environments $E$, and criterion for ranking strategies $X$. A given adaptive plan is specified within this framework given the following set of objects: a search space $A$, a set of operators $O$, and feedback from the environment $I$. Holland proposed a series of fundamental questions when considering the definition for an adaptive system, which he rephrases within the context of the formalism (see Table (below)).
Adaptive Systems
Adaptive Systems Formalism
@@ -60,25 +60,25 @@
Adaptive Systems Formalism
Description
-
$["e"]$
+$e$
Environment
The environment of the system undergoing adaptation.
-
$["s"]$
+$s$
Strategy
The adaptive plan which determines successive structural modifications in response to the environment.
-
$["U"]$
+$U$
Utility
-A measure of performance or payoff of different structures in the environment. Maps a given solution ($["A"]$) to a real number evaluation.
+A measure of performance or payoff of different structures in the environment. Maps a given solution ($A$) to a real number evaluation.
@@ -87,45 +87,45 @@
Adaptive Systems Formalism
Description
-
$["A"]$
+$A$
Search Space
The set of attainable structures, solutions, and the domain of action for an adaptive plan.
-
$["E"]$
+$E$
Environments
-The range of different environments, where $["e"]$ is an instance. It may also represent the unknowns of the strategy about the environment.
+The range of different environments, where $e$ is an instance. It may also represent the unknowns of the strategy about the environment.
-
$["O"]$
+$O$
Operators
-Set of operators applied to an instance of $["A"]$ at time $["t"]$ ($["A_t"]$) to transform it into $["A_{t+1}"]$.
+Set of operators applied to an instance of $A$ at time $t$ ($A_t$) to transform it into $A_{t+1}$.
-
$["S"]$
+$S$
Strategies
-Set of plans applicable for a given environment (where $["s"]$ is an instance), that use operators from the set $["O"]$.
+Set of plans applicable for a given environment (where $s$ is an instance), that use operators from the set $O$.
-
$["X"]$
+$X$
Criterion
-Used to compare strategies (in the set $["S"]$), under the set of environments ($["E"]$). Takes into account the efficiency of a plan in different environments.
+Used to compare strategies (in the set $S$), under the set of environments ($E$). Takes into account the efficiency of a plan in different environments.
-
$["I"]$
+$I$
Feedback
-Set of possible environmental inputs and signals providing dynamic information to the system about the performance of a particular solution $["A"]$ in a particular environment $["E"]$.
+Set of possible environmental inputs and signals providing dynamic information to the system about the performance of a particular solution $A$ in a particular environment $E$.
-
$["M"]$
+$M$
Memory
-The memory or retained parts of the input history ($["I"]$) for a solution ($["A"]$).
+The memory or retained parts of the input history ($I$) for a solution ($A$).
@@ -173,18 +173,18 @@
@@ -134,31 +134,31 @@
Adaptive Systems Formalism
To what parts of its environment is the organism (system, organization) adapting?
-What is $["E"]$?
+What is $E$?
How does the environment act upon the adapting organism (system, organization)?
-What is $["I"]$?
+What is $I$?
What structures are undergoing adaptation?
-What is $["A"]$?
+What is $A$?
What are the mechanisms of adaptation?
-What is $["O"]$?
+What is $O$?
What part of the history of its interaction with the environment does the organism (system, organization) retain in addition to that summarized in the structure tested?
-What is $["M"]$?
+What is $M$?
What limits are there to the adaptive process?
-What is $["S"]$?
+What is $S$?
How are different (hypotheses about) adaptive processes to be compared?
-What is $["X"]$?
+What is $X$?
Some Examples
From working within the formalism, Holland makes six observations regarding obstacles that may be encountered whilst investigating adaptive systems [Holland1975] (pages 159-160):
-Cavicchio provides perhaps one of the first applications of the formalism (after Holland) in his dissertation investigating Holland's reproductive plans [Cavicchio1970] (and to a lesser extent in [Cavicchio1972]). The work summarizes the formalism, presenting essentially the same framework, although he provides a specialization of the search space $["A"]$. The search space is broken down into a representation (codes), solutions (devices), and a mapping function from representation to solutions. The variation highlights the restriction the representation and mapping have on the designs available to the adaptive plan. Further, such mappings may not be one-to-one, there may be many instances in the representation space that map to the same solution (or the reverse). +Cavicchio provides perhaps one of the first applications of the formalism (after Holland) in his dissertation investigating Holland's reproductive plans [Cavicchio1970] (and to a lesser extent in [Cavicchio1972]). The work summarizes the formalism, presenting essentially the same framework, although he provides a specialization of the search space $A$. The search space is broken down into a representation (codes), solutions (devices), and a mapping function from representation to solutions. The variation highlights the restriction the representation and mapping have on the designs available to the adaptive plan. Further, such mappings may not be one-to-one, there may be many instances in the representation space that map to the same solution (or the reverse).
-Although not explicitly defined, Holland's specification of structures $["A"]$ is clear in pointing out that the structures are not bound to a level of abstraction; the definition covers structures at all levels. Nevertheless, Cavicchio's specialization for a representation-solution mapping was demonstrated to be useful in his exploration of reproductive plans (early Genetic Algorithms). He proposed that an adaptive system is first order if the utility function $["U"]$ for structures on an environment encompasses feedback $["I"]$. +Although not explicitly defined, Holland's specification of structures $A$ is clear in pointing out that the structures are not bound to a level of abstraction; the definition covers structures at all levels. Nevertheless, Cavicchio's specialization for a representation-solution mapping was demonstrated to be useful in his exploration of reproductive plans (early Genetic Algorithms). He proposed that an adaptive system is first order if the utility function $U$ for structures on an environment encompasses feedback $I$.
Cavicchio described the potential independence (component-wise) and linearity of the utility function with respect to the representation used. De Jong also employed the formalism to investigate reproductive plans in his dissertation research [Jong1975]. He indicated that the formalism covers the essential characteristics of adaptation, where the performance of a solution is a function of its characteristics and its environment. Adaptation is defined as a strategy for generating better-performing solutions to a problem by reducing initial uncertainty about the environment via feedback from the evaluation of individual solutions. De Jong used the formalism to define a series of genetic reproductive plans, which he investigated in the context of function optimization. diff --git a/docs/nature-inspired/advanced/problem_solving.html b/docs/nature-inspired/advanced/problem_solving.html index b69ad348..9dcbb589 100644 --- a/docs/nature-inspired/advanced/problem_solving.html +++ b/docs/nature-inspired/advanced/problem_solving.html @@ -182,7 +182,7 @@
Vector Quantization -Vector Quantization (VQ) refers to a method of approximating a target function using a set of exemplar (prototype or codebook) vectors. The exemplars represent a discrete subset of the problem, generally restricted to the features of interest using the natural representation of the observations in the problem space, typically an an unconstrained $["n"]$-dimensional real valued space. The VQ method provides the advantage of a non-parametric model of a target function (like instance-based and lazy learning such as the $["k"]$-Nearest-Neighbor method (kNN)) using a symbolic representation that is meaningful in the domain (like tree-based approaches). +Vector Quantization (VQ) refers to a method of approximating a target function using a set of exemplar (prototype or codebook) vectors. The exemplars represent a discrete subset of the problem, generally restricted to the features of interest using the natural representation of the observations in the problem space, typically an an unconstrained $n$-dimensional real valued space. The VQ method provides the advantage of a non-parametric model of a target function (like instance-based and lazy learning such as the $k$-Nearest-Neighbor method (kNN)) using a symbolic representation that is meaningful in the domain (like tree-based approaches).
The promotion of compression addresses the storage and retrieval concerns of kNN, although the selection of codebook vectors (the so-called quantization problem) is a hard problem that is known to be NP-complete [Garey1982]. More recently Kuncheva and Bezdek have worked towards unifying quantization methods in the application to classification problems, referring to the approaches as Nearest Prototype Classifiers (NPC) and proposing a generalized nearest prototype classifier [Kuncheva1998] [Kuncheva1998a]. @@ -199,7 +199,7 @@
-Bootstrap Aggregation (bagging) involves partitioning the observations into $["N"]$ randomly chosen subsets (with re-selection), and training a different model on each [Breiman1996]. Although robust to noisy datasets, the approach requires careful consideration as to the consensus mechanism between the independent models for decision making. +Bootstrap Aggregation (bagging) involves partitioning the observations into $N$ randomly chosen subsets (with re-selection), and training a different model on each [Breiman1996]. Although robust to noisy datasets, the approach requires careful consideration as to the consensus mechanism between the independent models for decision making.
Stacked Generalization (stacking) involves creating a sequence of models of generally different types arranged into a stack, where subsequently added models generalize the behavior (success or failure) of the model before it with the intent of correcting erroneous decision making [Wolpert1992] [Ting1999]. diff --git a/docs/nature-inspired/advanced/visualizing_algorithms.html b/docs/nature-inspired/advanced/visualizing_algorithms.html index 9d73adcc..6c519047 100644 --- a/docs/nature-inspired/advanced/visualizing_algorithms.html +++ b/docs/nature-inspired/advanced/visualizing_algorithms.html @@ -64,7 +64,7 @@
-A continuous function optimization problem is typically visualized in two dimensions as a line where $["x=input, y=f(input)"]$ or three dimensions as a surface where $["x,y=input, z=f(input)"]$. +A continuous function optimization problem is typically visualized in two dimensions as a line where $x=input, y=f(input)$ or three dimensions as a surface where $x,y=input, z=f(input)$.
Some functions may have many more dimensions, which if the function is linearly separable can be visualized in lower dimensions. Functions that are not linearly-separable may be able to make use of projection techniques such as Principle Component Analysis (PCA). For example, preparing a stratified sample of the search space as vectors with associated cost function value and using PCA to project the vectors onto a two-dimensional plane for visualization. @@ -73,7 +73,7 @@
-Figure (below) provides an example of the Basin function in one dimension. The Basin function is a continuous function optimization that seeks $["\\min f(x)"]$ where $["f=\\sum_{i=1}^n x_{i}^2"]$, $["-5.0\\leq x_i \\leq 5.0"]$. The optimal solution for this function is $["(v_0,\\ldots,v_{n-1})=0.0"]$. Listing (below) provides the Gnuplot script used to prepare the plot ($["n=1"]$). +Figure (below) provides an example of the Basin function in one dimension. The Basin function is a continuous function optimization that seeks $\min f(x)$ where $f=\sum_{i=1}^n x_{i}^2$, $-5.0\leq x_i \leq 5.0$. The optimal solution for this function is $(v_0,\ldots,v_{n-1})=0.0$. Listing (below) provides the Gnuplot script used to prepare the plot ($n=1$).
-Both plots show the optimum in the center of the domain at $["x=0.0"]$ in one-dimension and $["x,y=0.0"]$ in two-dimensions. +Both plots show the optimum in the center of the domain at $x=0.0$ in one-dimension and $x,y=0.0$ in two-dimensions.
diff --git a/docs/nature-inspired/evolution/differential_evolution.html b/docs/nature-inspired/evolution/differential_evolution.html index 7860f345..e907f5c3 100644 --- a/docs/nature-inspired/evolution/differential_evolution.html +++ b/docs/nature-inspired/evolution/differential_evolution.html @@ -120,8 +120,8 @@
Listing (below) provides an example of the Differential Evolution algorithm implemented in the Ruby Programming Language.
-The demonstration problem is an instance of a continuous function optimization that seeks $["\\min f(x)"]$ where $["f=\\sum_{i=1}^n x_{i}^2"]$, $["-5.0\\leq x_i \\leq 5.0"]$ and $["n=3"]$. The optimal solution for this basin function is $["(v_0,\\ldots,v_{n-1})=0.0"]$.
+The demonstration problem is an instance of a continuous function optimization that seeks $\min f(x)$ where $f=\sum_{i=1}^n x_{i}^2$, $-5.0\leq x_i \leq 5.0$ and $n=3$. The optimal solution for this basin function is $(v_0,\ldots,v_{n-1})=0.0$.
The algorithm is an implementation of Differential Evolution with the DE/rand/1/bin configuration proposed by Storn and Price [Storn1997].
diff --git a/docs/nature-inspired/evolution/evolution_strategies.html b/docs/nature-inspired/evolution/evolution_strategies.html index 0fc4cb12..7327d082 100644 --- a/docs/nature-inspired/evolution/evolution_strategies.html +++ b/docs/nature-inspired/evolution/evolution_strategies.html @@ -58,8 +58,8 @@Strategy
Procedure
-Instances of Evolution Strategies algorithms may be concisely described with a custom terminology in the form $["(\\mu,\\lambda)-ES"]$, where $["\\mu"]$ is number of candidate solutions in the parent generation, and $["\\lambda"]$ is the number of candidate solutions generated from the parent generation. In this configuration, the best $["\\mu"]$ are kept if $["\\lambda > \\mu"]$, where $["\\lambda"]$ must be great or equal to $["\\mu"]$. In addition to the so-called comma-selection Evolution Strategies algorithm, a plus-selection variation may be defined $["(\\mu + \\lambda)-ES"]$, where the best members of the union of the $["\\mu"]$ and $["\\lambda"]$ generations compete based on objective fitness for a position in the next generation. The simplest configuration is the $["(1+1)-ES"]$, which is a type of greedy hill climbing algorithm. -Algorithm (below) provides a pseudocode listing of the $["(\\mu,\\lambda)-ES"]$ algorithm for minimizing a cost function. The algorithm shows the adaptation of candidate solutions that co-adapt their own strategy parameters that influence the amount of mutation applied to a candidate solutions descendants. +Instances of Evolution Strategies algorithms may be concisely described with a custom terminology in the form $(\mu,\lambda)-ES$, where $\mu$ is number of candidate solutions in the parent generation, and $\lambda$ is the number of candidate solutions generated from the parent generation. In this configuration, the best $\mu$ are kept if $\lambda > \mu$, where $\lambda$ must be great or equal to $\mu$. In addition to the so-called comma-selection Evolution Strategies algorithm, a plus-selection variation may be defined $(\mu + \lambda)-ES$, where the best members of the union of the $\mu$ and $\lambda$ generations compete based on objective fitness for a position in the next generation. The simplest configuration is the $(1+1)-ES$, which is a type of greedy hill climbing algorithm. +Algorithm (below) provides a pseudocode listing of the $(\mu,\lambda)-ES$ algorithm for minimizing a cost function. The algorithm shows the adaptation of candidate solutions that co-adapt their own strategy parameters that influence the amount of mutation applied to a candidate solutions descendants.
- +Heuristics
Listing (below) provides an example of the Evolution Strategies algorithm implemented in the Ruby Programming Language. -The demonstration problem is an instance of a continuous function optimization that seeks $["\\min f(x)"]$ where $["f=\\sum_{i=1}^n x_{i}^2"]$, $["-5.0\\leq x_i \\leq 5.0"]$ and $["n=2"]$. The optimal solution for this basin function is $["(v_0,\\ldots,v_{n-1})=0.0"]$. +The demonstration problem is an instance of a continuous function optimization that seeks $\min f(x)$ where $f=\sum_{i=1}^n x_{i}^2$, $-5.0\leq x_i \leq 5.0$ and $n=2$. The optimal solution for this basin function is $(v_0,\ldots,v_{n-1})=0.0$. The algorithm is a implementation of Evolution Strategies based on simple version described by Bäck and Schwefel [Back1993b], which was also used as the basis of a detailed empirical study [Yao1997]. -The algorithm is an $["(30+20)-ES"]$ that adapts both the problem and strategy (standard deviations) variables. +The algorithm is an $(30+20)-ES$ that adapts both the problem and strategy (standard deviations) variables. More contemporary implementations may modify the strategy variables differently, and include an additional set of adapted strategy parameters to influence the direction of mutation (see [Rudolph2000] for a concise description).
diff --git a/docs/nature-inspired/evolution/evolutionary_programming.html b/docs/nature-inspired/evolution/evolutionary_programming.html index 118fb007..5c870ca2 100644 --- a/docs/nature-inspired/evolution/evolutionary_programming.html +++ b/docs/nature-inspired/evolution/evolutionary_programming.html @@ -115,7 +115,7 @@Heuristics
Code Listing
Listing (below) provides an example of the Evolutionary Programming algorithm implemented in the Ruby Programming Language. -The demonstration problem is an instance of a continuous function optimization that seeks $["\\min f(x)"]$ where $["f=\\sum_{i=1}^n x_{i}^2"]$, $["-5.0\\leq x_i \\leq 5.0"]$ and $["n=2"]$. The optimal solution for this basin function is $["(v_0,\\ldots,v_{n-1})=0.0"]$. +The demonstration problem is an instance of a continuous function optimization that seeks $\min f(x)$ where $f=\sum_{i=1}^n x_{i}^2$, $-5.0\leq x_i \leq 5.0$ and $n=2$. The optimal solution for this basin function is $(v_0,\ldots,v_{n-1})=0.0$. The algorithm is an implementation of Evolutionary Programming based on the classical implementation for continuous function optimization by Fogel et al. [Fogel1991a] with per-variable adaptive variance based on Fogel's description for a self-adaptive variation on page 160 of his 1995 book [Fogel1995].
diff --git a/docs/nature-inspired/evolution/gene_expression_programming.html b/docs/nature-inspired/evolution/gene_expression_programming.html index 8560469e..11a5b6c6 100644 --- a/docs/nature-inspired/evolution/gene_expression_programming.html +++ b/docs/nature-inspired/evolution/gene_expression_programming.html @@ -107,13 +107,13 @@Procedure
Heuristics
Listing (below) provides an example of the Gene Expression Programming algorithm implemented in the Ruby Programming Language based on the seminal version proposed by Ferreira [Ferreira2001]. -The demonstration problem is an instance of symbolic regression $["f(x)=x^4+x^3+x^2+x"]$, where $["x\\in[1,10]"]$. The grammar used in this problem is: Functions: $["F=\\{+,-,\\div,\\times,\\}"]$ and Terminals: $["T=\\{x\\}"]$. +The demonstration problem is an instance of symbolic regression $f(x)=x^4+x^3+x^2+x$, where $x\in[1,10]$. The grammar used in this problem is: Functions: $F={+,-,\div,\times,}$ and Terminals: $T={x}$.
The algorithm uses binary tournament selection, uniform crossover and point mutations. The K-expression is decoded to an expression tree in a breadth-first manner, which is then parsed depth first as a Ruby expression string for display and direct evaluation. diff --git a/docs/nature-inspired/evolution/genetic_algorithm.html b/docs/nature-inspired/evolution/genetic_algorithm.html index 13ce838c..3fda1873 100644 --- a/docs/nature-inspired/evolution/genetic_algorithm.html +++ b/docs/nature-inspired/evolution/genetic_algorithm.html @@ -98,7 +98,7 @@
-The demonstration problem is an instance of a symbolic regression, where a function must be devised to match a set of observations. In this case the target function is a quadratic polynomial $["x^2+x+1"]$ where $["x \\in [-1,1]"]$. The observations are generated directly from the target function without noise for the purposes of this example. In practical problems, if one knew and had access to the target function then the genetic program would not be required. +The demonstration problem is an instance of a symbolic regression, where a function must be devised to match a set of observations. In this case the target function is a quadratic polynomial $x^2+x+1$ where $x \in [-1,1]$. The observations are generated directly from the target function without noise for the purposes of this example. In practical problems, if one knew and had access to the target function then the genetic program would not be required.
-The algorithm is configured to search for a program with the function set $["\\{ +, -, \\times, \\div \\}"]$ and the terminal set $["\\{ X, R \\}"]$, where $["X"]$ is the input value, and $["R"]$ is a static random variable generated for a program $["X \\in [-5,5]"]$. A division by zero returns a value of one. +The algorithm is configured to search for a program with the function set ${ +, -, \times, \div }$ and the terminal set ${ X, R }$, where $X$ is the input value, and $R$ is a static random variable generated for a program $X \in [-5,5]$. A division by zero returns a value of one. The fitness of a candidate solution is calculated by evaluating the program on range of random input values and calculating the Root Mean Squared Error (RMSE). The algorithm is configured with a 90% probability of crossover, 8% probability of reproduction (copying), and a 2% probability of mutation. For brevity, the algorithm does not implement the architecture altering genetic operation and does not bias crossover points towards functions over terminals. diff --git a/docs/nature-inspired/evolution/grammatical_evolution.html b/docs/nature-inspired/evolution/grammatical_evolution.html index e628f5f7..11fdfdf1 100644 --- a/docs/nature-inspired/evolution/grammatical_evolution.html +++ b/docs/nature-inspired/evolution/grammatical_evolution.html @@ -67,7 +67,7 @@
A grammar is defined in Backus Normal Form (BNF), which is a context free grammar expressed as a series of production rules comprised of terminals and non-terminals. -A variable-length binary string representation is used for the optimization process. Bits are read from the a candidate solutions genome in blocks of 8 called a codon, and decoded to an integer (in the range between 0 and $["2^{8}-1"]$). If the end of the binary string is reached when reading integers, the reading process loops back to the start of the string, effectively creating a circular genome. The integers are mapped to expressions from the BNF until a complete syntactically correct expression is formed. This may not use a solutions entire genome, or use the decoded genome more than once given it's circular nature. +A variable-length binary string representation is used for the optimization process. Bits are read from the a candidate solutions genome in blocks of 8 called a codon, and decoded to an integer (in the range between 0 and $2^{8}-1$). If the end of the binary string is reached when reading integers, the reading process loops back to the start of the string, effectively creating a circular genome. The integers are mapped to expressions from the BNF until a complete syntactically correct expression is formed. This may not use a solutions entire genome, or use the decoded genome more than once given it's circular nature. Algorithm (below) provides a pseudocode listing of the Grammatical Evolution algorithm for minimizing a cost function.
Listing (below) provides an example of the Grammatical Evolution algorithm implemented in the Ruby Programming Language based on the version described by O'Neill and Ryan [ONeill2001]. -The demonstration problem is an instance of symbolic regression $["f(x)=x^4+x^3+x^2+x"]$, where $["x\\in[1,10]"]$. +The demonstration problem is an instance of symbolic regression $f(x)=x^4+x^3+x^2+x$, where $x\in[1,10]$. The grammar used in this problem is:
<expr>
<expr>
The production rules for the grammar in BNF are:
<expr>
$["::="]$ <expr><op><expr>
, (<expr><op><expr>)
, <pre_op>(<expr>)
, <var>
<op>
$["::="]$ $["+, -, \\div, \\times"]$<var>
$["::="]$ x, 1.0<expr>
$::=$ <expr><op><expr>
, (<expr><op><expr>)
, <pre_op>(<expr>)
, <var>
<op>
$::=$ $+, -, \div, \times$<var>
$::=$ x, 1.0The algorithm uses point mutation and a codon-respecting one-point crossover operator. Binary tournament selection is used to determine the parent population's contribution to the subsequent generation. -Binary strings are decoded to integers using an unsigned binary. Candidate solutions are then mapped directly into executable Ruby code and executed. A given candidate solution is evaluated by comparing its output against the target function and taking the sum of the absolute errors over a number of trials. The probabilities of point mutation, codon deletion, and codon duplication are hard coded as relative probabilities to each solution, although should be parameters of the algorithm. In this case they are heuristically defined as $["\\frac{1.0}{L}"]$, $["\\frac{0.5}{NC}"]$ and $["\\frac{1.0}{NC}"]$ respectively, where $["L"]$ is the total number of bits, and $["NC"]$ is the number of codons in a given candidate solution. +Binary strings are decoded to integers using an unsigned binary. Candidate solutions are then mapped directly into executable Ruby code and executed. A given candidate solution is evaluated by comparing its output against the target function and taking the sum of the absolute errors over a number of trials. The probabilities of point mutation, codon deletion, and codon duplication are hard coded as relative probabilities to each solution, although should be parameters of the algorithm. In this case they are heuristically defined as $\frac{1.0}{L}$, $\frac{0.5}{NC}$ and $\frac{1.0}{NC}$ respectively, where $L$ is the total number of bits, and $NC$ is the number of codons in a given candidate solution.
Solutions are evaluated by generating a number of random samples from the domain and calculating the mean error of the program to the expected outcome. Programs that contain a single term or those that return an invalid (NaN) or infinite result are penalized with an enormous error value. diff --git a/docs/nature-inspired/evolution/learning_classifier_system.html b/docs/nature-inspired/evolution/learning_classifier_system.html index f2a4315d..d88bc69a 100644 --- a/docs/nature-inspired/evolution/learning_classifier_system.html +++ b/docs/nature-inspired/evolution/learning_classifier_system.html @@ -53,7 +53,7 @@
The actors of the system include detectors, messages, effectors, feedback, and classifiers. Detectors are used by the system to perceive the state of the environment. Messages are the discrete information packets passed from the detectors into the system. The system performs information processing on messages, and messages may directly result in actions in the environment. Effectors control the actions of the system on and within the environment. In addition to the system actively perceiving via its detections, it may also receive directed feedback from the environment (payoff). Classifiers are condition-action rules that provide a filter for messages. If a message satisfies the conditional part of the classifier, the action of the classifier triggers. Rules act as message processors. -Message a fixed length bitstring. A classifier is defined as a ternary string with an alphabet $["\\in \\{1, 0, \\#\\}"]$, where the $["\\#"]$ represents do not care (matching either 1 or 0). +Message a fixed length bitstring. A classifier is defined as a ternary string with an alphabet $\in {1, 0, #}$, where the $#$ represents do not care (matching either 1 or 0).
The processing loop for the Learning Classifier system is as follows: @@ -115,17 +115,17 @@
Listing (below) provides an example of the Learning Classifier System algorithm implemented in the Ruby Programming Language. -The problem is an instance of a Boolean multiplexer called the 6-multiplexer. It can be described as a classification problem, where each of the $["2^6"]$ patterns of bits is associated with a boolean class $["\\in \\{1,0\\}"]$. For this problem instance, the first two bits may be decoded as an address into the remaining four bits that specify the class (for example in 100011, '10' decode to the index of '2' in the remaining 4 bits making the class '1'). In propositional logic this problem instance may be described as $["F=(\\neg x_0) (\\neg x_1) x_2 + (\\neg x_0) x_1 x_3 + x_0 (\\neg x_1) x_4 + x_0 x_1 x_5"]$. +The problem is an instance of a Boolean multiplexer called the 6-multiplexer. It can be described as a classification problem, where each of the $2^6$ patterns of bits is associated with a boolean class $\in {1,0}$. For this problem instance, the first two bits may be decoded as an address into the remaining four bits that specify the class (for example in 100011, '10' decode to the index of '2' in the remaining 4 bits making the class '1'). In propositional logic this problem instance may be described as $F=(\neg x_0) (\neg x_1) x_2 + (\neg x_0) x_1 x_3 + x_0 (\neg x_1) x_4 + x_0 x_1 x_5$. The algorithm is an instance of XCS based on the description provided by Butz and Wilson [Butz2002a] with the parameters based on the application of XCS to Boolean multiplexer problems by Wilson [Wilson1995] [Wilson1998]. -The population is grown as needed, and subsumption which would be appropriate for the Boolean multiplexer problem was not used for brevity. The multiplexer problem is a single step problem, so the complexities of delayed payoff are not required. A number of parameters were hard coded to recommended values, specifically: $["\\alpha=0.1"]$, $["v=-0.5"]$, $["\\delta=0.1"]$ and $["P_{\\#}=\\frac{1}{3}"]$. +The population is grown as needed, and subsumption which would be appropriate for the Boolean multiplexer problem was not used for brevity. The multiplexer problem is a single step problem, so the complexities of delayed payoff are not required. A number of parameters were hard coded to recommended values, specifically: $\alpha=0.1$, $v=-0.5$, $\delta=0.1$ and $P_{#}=\frac{1}{3}$.
def neg(bit) diff --git a/docs/nature-inspired/evolution/nsga.html b/docs/nature-inspired/evolution/nsga.html index a9928747..a334c2e7 100644 --- a/docs/nature-inspired/evolution/nsga.html +++ b/docs/nature-inspired/evolution/nsga.html @@ -111,9 +111,9 @@Heuristics
Code Listing
Listing (below) provides an example of the Non-dominated Sorting Genetic Algorithm II (NSGA-II) implemented in the Ruby Programming Language. -The demonstration problem is an instance of continuous multiple objective function optimization called SCH (problem one in [Deb2002]). The problem seeks the minimum of two functions: $["f1=\\sum_{i=1}^n x_{i}^2"]$ and $["f2=\\sum_{i=1}^n (x_{i}-2)^2"]$, $["-10\\leq x_i \\leq 10"]$ and $["n=1"]$. The optimal solution for this function are $["x \\in [0,2]"]$. +The demonstration problem is an instance of continuous multiple objective function optimization called SCH (problem one in [Deb2002]). The problem seeks the minimum of two functions: $f1=\sum_{i=1}^n x_{i}^2$ and $f2=\sum_{i=1}^n (x_{i}-2)^2$, $-10\leq x_i \leq 10$ and $n=1$. The optimal solution for this function are $x \in [0,2]$. The algorithm is an implementation of NSGA-II based on the presentation by Deb et al. [Deb2002]. -The algorithm uses a binary string representation (16 bits per objective function parameter) that is decoded and rescaled to the function domain. The implementation uses a uniform crossover operator and point mutations with a fixed mutation rate of $["\\frac{1}{L}"]$, where $["L"]$ is the number of bits in a solution's binary string. +The algorithm uses a binary string representation (16 bits per objective function parameter) that is decoded and rescaled to the function domain. The implementation uses a uniform crossover operator and point mutations with a fixed mutation rate of $\frac{1}{L}$, where $L$ is the number of bits in a solution's binary string.
def objective1(vector) @@ -321,7 +321,7 @@References
Primary Sources
Srinivas and Deb proposed the NSGA inspired by Goldberg's notion of a non-dominated sorting procedure [Srinivas1994]. Goldberg proposed a non-dominated sorting procedure in his book in considering the biases in the Pareto optimal solutions provided by VEGA [Goldberg1989]. Srinivas and Deb's NSGA used the sorting procedure as a ranking selection method, and a fitness sharing niching method to maintain stable sub-populations across the Pareto front. -Deb et al. later extended NSGA to address three criticism of the approach: the $["O(mN^3)"]$ time complexity, the lack of elitism, and the need for a sharing parameter for the fitness sharing niching method [Deb2000] [Deb2002]. +Deb et al. later extended NSGA to address three criticism of the approach: the $O(mN^3)$ time complexity, the lack of elitism, and the need for a sharing parameter for the fitness sharing niching method [Deb2000] [Deb2002].
diff --git a/docs/nature-inspired/evolution/spea.html b/docs/nature-inspired/evolution/spea.html index acb9e461..48342baa 100644 --- a/docs/nature-inspired/evolution/spea.html +++ b/docs/nature-inspired/evolution/spea.html @@ -55,9 +55,9 @@Procedure
Algorithm (below) provides a pseudocode listing of the Strength Pareto Evolutionary Algorithm 2 (SPEA2) for minimizing a cost function. The
CalculateRawFitness
function calculates the raw fitness as the sum of the strength values of the solutions that dominate a given candidate, where strength is the number of solutions that a give solution dominate. -TheCandidateDensity
function estimates the density of an area of the Pareto front as $["\\frac{1.0}{\\sigma^k + 2}"]$ where $["\\sigma^k"]$ is the Euclidean distance of the objective values between a given solution the $["k"]$th nearest neighbor of the solution, and $["k"]$ is the square root of the size of the population and archive combined. +TheCandidateDensity
function estimates the density of an area of the Pareto front as $\frac{1.0}{\sigma^k + 2}$ where $\sigma^k$ is the Euclidean distance of the objective values between a given solution the $k$th nearest neighbor of the solution, and $k$ is the square root of the size of the population and archive combined. ThePopulateWithRemainingBest
function iteratively fills the archive with the remaining candidate solutions in order of fitness. -TheRemoveMostSimilar
function truncates the archive population removing those members with the smallest $["\\sigma^k"]$ values as calculated against the archive. +TheRemoveMostSimilar
function truncates the archive population removing those members with the smallest $\sigma^k$ values as calculated against the archive. TheSelectParents
function selects parents from a population using a Genetic Algorithm selection method such as binary tournament selection. TheCrossoverAndMutation
function performs the crossover and mutation genetic operators from the Genetic Algorithm.@@ -98,7 +98,7 @@Heuristics
@@ -107,9 +107,9 @@
- SPEA was designed for and is suited to combinatorial and continuous function multiple objective optimization problem instances.
- A binary representation can be used for continuous function optimization problems in conjunction with classical genetic operators such as one-point crossover and point mutation.
-- A $["k"]$ value of 1 may be used for efficiency whilst still providing useful results.
+- A $k$ value of 1 may be used for efficiency whilst still providing useful results.
- The size of the archive is commonly smaller than the size of the population.
- There is a lot of room for implementation optimization in density and Pareto dominance calculations.
Heuristics
Code Listing
Listing (below) provides an example of the Strength Pareto Evolutionary Algorithm 2 (SPEA2) implemented in the Ruby Programming Language. -The demonstration problem is an instance of continuous multiple objective function optimization called SCH (problem one in [Deb2002]). The problem seeks the minimum of two functions: $["f1=\\sum_{i=1}^n x_{i}^2"]$ and $["f2=\\sum_{i=1}^n (x_{i}-2)^2"]$, $["-10\\leq x_i \\leq 10"]$ and $["n=1"]$. The optimal solutions for this function are $["x \\in [0,2]"]$. +The demonstration problem is an instance of continuous multiple objective function optimization called SCH (problem one in [Deb2002]). The problem seeks the minimum of two functions: $f1=\sum_{i=1}^n x_{i}^2$ and $f2=\sum_{i=1}^n (x_{i}-2)^2$, $-10\leq x_i \leq 10$ and $n=1$. The optimal solutions for this function are $x \in [0,2]$. The algorithm is an implementation of SPEA2 based on the presentation by Zitzler, Laumanns, and Thiele [Zitzler2002]. -The algorithm uses a binary string representation (16 bits per objective function parameter) that is decoded and rescaled to the function domain. The implementation uses a uniform crossover operator and point mutations with a fixed mutation rate of $["\\frac{1}{L}"]$, where $["L"]$ is the number of bits in a solution's binary string. +The algorithm uses a binary string representation (16 bits per objective function parameter) that is decoded and rescaled to the function domain. The implementation uses a uniform crossover operator and point mutations with a fixed mutation rate of $\frac{1}{L}$, where $L$ is the number of bits in a solution's binary string.
def objective1(vector) diff --git a/docs/nature-inspired/immune/airs.html b/docs/nature-inspired/immune/airs.html index 8b117cfd..ad0577f2 100644 --- a/docs/nature-inspired/immune/airs.html +++ b/docs/nature-inspired/immune/airs.html @@ -70,7 +70,7 @@Procedure
$dist(x,c) = \sum_{i=1}^{n} (x_i - c_i)^2$-where $["n"]$ is the number of attributes, $["x"]$ is the input vector and $["c"]$ is a given cell vector. The variation of cells during cloning (somatic hypermutation) occurs inversely proportional to the stimulation of a given cell to an input pattern. +where $n$ is the number of attributes, $x$ is the input vector and $c$ is a given cell vector. The variation of cells during cloning (somatic hypermutation) occurs inversely proportional to the stimulation of a given cell to an input pattern.
Input
: @@ -117,20 +117,20 @@Heuristics
- The AIRS was designed as a supervised algorithm for classification problem domains.
- The AIRS is non-parametric, meaning that it does not rely on assumptions about that structure of the function that is is approximating.
-- Real-values in input vectors should be normalized such that $["x \\in [0,1)"]$.
+- Real-values in input vectors should be normalized such that $x \in [0,1)$.
- Euclidean distance is commonly used to measure the distance between real-valued vectors (affinity calculation), although other distance measures may be used (such as dot product), and data specific distance measures may be required for non-scalar attributes.
- Cells may be initialized with small random values or more commonly with values from instances in the training set.
-- A cell's affinity is typically minimizing, where as a cells stimulation is maximizing and typically $["\\in [0,1]"]$.
+- A cell's affinity is typically minimizing, where as a cells stimulation is maximizing and typically $\in [0,1]$.
Code Listing
Listing (below) provides an example of the Artificial Immune Recognition System implemented in the Ruby Programming Language. -The problem is a contrived classification problem in a 2-dimensional domain $["x\\in[0,1], y\\in[0,1]"]$ with two classes: 'A' ($["x\\in[0,0.4999999], y\\in[0,0.4999999]"]$) and 'B' ($["x\\in[0.5,1], y\\in[0.5,1]"]$). +The problem is a contrived classification problem in a 2-dimensional domain $x\in[0,1], y\in[0,1]$ with two classes: 'A' ($x\in[0,0.4999999], y\in[0,0.4999999]$) and 'B' ($x\in[0.5,1], y\in[0.5,1]$).
-The algorithm is an implementation of the AIRS2 algorithm [Watkins2002b]. An initial pool of memory cells is created, one cell for each class. Euclidean distance divided by the maximum possible distance in the domain is taken as the affinity and stimulation is taken as $["1.0-affinity"]$. The meta-dynamics for memory cells (competition for input patterns) is not performed and may be added into the implementation as an extension. +The algorithm is an implementation of the AIRS2 algorithm [Watkins2002b]. An initial pool of memory cells is created, one cell for each class. Euclidean distance divided by the maximum possible distance in the domain is taken as the affinity and stimulation is taken as $1.0-affinity$. The meta-dynamics for memory cells (competition for input patterns) is not performed and may be added into the implementation as an extension.
def random_vector(minmax) diff --git a/docs/nature-inspired/immune/clonal_selection_algorithm.html b/docs/nature-inspired/immune/clonal_selection_algorithm.html index c3d8d238..c6f9e146 100644 --- a/docs/nature-inspired/immune/clonal_selection_algorithm.html +++ b/docs/nature-inspired/immune/clonal_selection_algorithm.html @@ -103,18 +103,18 @@Heuristics
- The CLONALG was designed as a general machine learning approach and has been applied to pattern recognition, function optimization, and combinatorial optimization problem domains.
- Binary string representations are used and decoded to a representation suitable for a specific problem domain.
-- The number of clones created for each selected member is calculated as a function of the repertoire size $["N_c=round(\\beta \\cdot N)"]$, where $["\\beta"]$ is the user parameter $["Clone_{rate}"]$.
+- The number of clones created for each selected member is calculated as a function of the repertoire size $N_c=round(\beta \cdot N)$, where $\beta$ is the user parameter $Clone_{rate}$.
- A rank-based affinity-proportionate function is used to determine the number of clones created for selected members of the population for pattern recognition problem instances.
- The number of random antibodies inserted each iteration is typically very low (1-2).
- Point mutations (bit-flips) are used in the hypermutation operation.
-- The function $["exp(-\\rho \\cdot f)"]$ is used to determine the probability of individual component mutation for a given candidate solution, where $["f"]$ is the candidates affinity (normalized maximizing cost value), and $["\\rho"]$ is the user parameter $["Mutation_{rate}"]$.
+- The function $exp(-\rho \cdot f)$ is used to determine the probability of individual component mutation for a given candidate solution, where $f$ is the candidates affinity (normalized maximizing cost value), and $\rho$ is the user parameter $Mutation_{rate}$.
Code Listing
Listing (below) provides an example of the Clonal Selection Algorithm (CLONALG) implemented in the Ruby Programming Language. -The demonstration problem is an instance of a continuous function optimization that seeks $["\\min f(x)"]$ where $["f=\\sum_{i=1}^n x_{i}^2"]$, $["-5.0\\leq x_i \\leq 5.0"]$ and $["n=3"]$. The optimal solution for this basin function is $["(v_0,\\ldots,v_{n-1})=0.0"]$. +The demonstration problem is an instance of a continuous function optimization that seeks $\min f(x)$ where $f=\sum_{i=1}^n x_{i}^2$, $-5.0\leq x_i \leq 5.0$ and $n=3$. The optimal solution for this basin function is $(v_0,\ldots,v_{n-1})=0.0$. The algorithm is implemented as described by de Castro and Von Zuben for function optimization [Castro2002a].
diff --git a/docs/nature-inspired/immune/dca.html b/docs/nature-inspired/immune/dca.html index cd843999..3dafc406 100644 --- a/docs/nature-inspired/immune/dca.html +++ b/docs/nature-inspired/immune/dca.html @@ -60,7 +60,7 @@Strategy
Procedure
Algorithm (below) provides pseudocode for training a pool of cells in the Dendritic Cell Algorithm, specifically the Deterministic Dendritic Cell Algorithm. Mature migrated cells associate their collected input patterns with anomalies, whereas semi-mature migrated cells associate their collected input patterns as normal. -The resulting migrated cells can then be used to classify input patterns as normal or anomalous. This can be done through sampling the cells and using a voting mechanism, or more elaborate methods such as a 'mature context antigen value' (MCAV) that uses $["\\frac{M}{Ag}"]$ (where $["M"]$ is the number of mature cells with the antigen and $["Ag"]$ is the sum of the exposures to the antigen by those mature cells), which gives a probability of a pattern being an anomaly. +The resulting migrated cells can then be used to classify input patterns as normal or anomalous. This can be done through sampling the cells and using a voting mechanism, or more elaborate methods such as a 'mature context antigen value' (MCAV) that uses $\frac{M}{Ag}$ (where $M$ is the number of mature cells with the antigen and $Ag$ is the sum of the exposures to the antigen by those mature cells), which gives a probability of a pattern being an anomaly.
Input
: @@ -102,17 +102,17 @@Heuristics
- The Dendritic Cell Algorithm is not specifically a classification algorithm, it may be considered a data filtering method for use in anomaly detection problems.
- The canonical algorithm is designed to operate on a single discrete, categorical or ordinal input and two probabilistic specific signals indicating the heuristic danger or safety of the input.
-- The
+danger
andsafe
signals are problem specific signals of the risk that the input pattern is an anomaly or is normal, both typically $["\\in [0,100]"]$.- The
danger
andsafe
signals are problem specific signals of the risk that the input pattern is an anomaly or is normal, both typically $\in [0,100]$.- The
danger
andsafe
signals do not have to be reciprocal, meaning they may provide conflicting information.- The system was designed to be used in real-time anomaly detection problems, not just static problem.
-- Each cells migration threshold is set separately, typically $["\\in [5,15]"]$
+- Each cells migration threshold is set separately, typically $\in [5,15]$
Code Listing
Listing (below) provides an example of the Dendritic Cell Algorithm implemented in the Ruby Programming Language, specifically the Deterministic Dendritic Cell Algorithm (dDCA). -The problem is a contrived anomaly-detection problem with ordinal inputs $["x\\ \\in\\ [0,50)"]$ , where values that divide by 10 with no remainder are considered anomalies. Probabilistic safe and danger signal functions are provided, suggesting danger signals correctly with $["P(danger)=0.70"]$, and safe signals correctly with $["P(safe)=0.95"]$. +The problem is a contrived anomaly-detection problem with ordinal inputs $x \in [0,50)$ , where values that divide by 10 with no remainder are considered anomalies. Probabilistic safe and danger signal functions are provided, suggesting danger signals correctly with $P(danger)=0.70$, and safe signals correctly with $P(safe)=0.95$.
The algorithm is an implementation of the Deterministic Dendritic Cell Algorithm (dDCA) as described in [Stibor2009] [Greensmith2008], with verification from [Greensmith2006a]. The algorithm was designed to be executed as three asynchronous processes in a real-time or semi-real time environment. For demonstration purposes, the implementation separated out the three main processes and executed the sequentially as a training and cell promotion phase followed by a test (labeling phase). diff --git a/docs/nature-inspired/immune/immune_network_algorithm.html b/docs/nature-inspired/immune/immune_network_algorithm.html index 674f1c5b..bf630e45 100644 --- a/docs/nature-inspired/immune/immune_network_algorithm.html +++ b/docs/nature-inspired/immune/immune_network_algorithm.html @@ -112,8 +112,8 @@
Heuristics
The addition of random cells each iteration adds a random-restart like capability to the algorithms. Suppression based on cell similarity provides a mechanism for reducing redundancy. The population size is dynamic, and if it continues to grow it may be an indication of a problem with many local optima or that the affinity threshold may needs to be increased. -Affinity proportionate mutation is performed using $["c' = c + \\alpha \\times N(1,0)"]$ where $["\\alpha = \\frac{1}{\\beta} \\times exp(-f)"]$, $["N"]$ is a Guassian random number, and $["f"]$ is the fitness of the parent cell, $["\\beta"]$ controls the decay of the function and can be set to 100. -The affinity threshold is problem and representation specific, for example a $["AffinityThreshold"]$ may be set to an arbitrary value such as 0.1 on a continuous function domain, or calculated as a percentage of the size of the problem space. +Affinity proportionate mutation is performed using $c' = c + \alpha \times N(1,0)$ where $\alpha = \frac{1}{\beta} \times exp(-f)$, $N$ is a Guassian random number, and $f$ is the fitness of the parent cell, $\beta$ controls the decay of the function and can be set to 100. +The affinity threshold is problem and representation specific, for example a $AffinityThreshold$ may be set to an arbitrary value such as 0.1 on a continuous function domain, or calculated as a percentage of the size of the problem space. The number of random cells inserted may be 40% of the population size. The number of clones created for a cell may be small, such as 10. @@ -122,7 +122,7 @@Heuristics
Code Listing
Listing (below) provides an example of the Optimization Artificial Immune Network (opt-aiNet) implemented in the Ruby Programming Language. -The demonstration problem is an instance of a continuous function optimization that seeks $["\\min f(x)"]$ where $["f=\\sum_{i=1}^n x_{i}^2"]$, $["-5.0\\leq x_i \\leq 5.0"]$ and $["n=2"]$. The optimal solution for this basin function is $["(v_0,\\ldots,v_{n-1})=0.0"]$. +The demonstration problem is an instance of a continuous function optimization that seeks $\min f(x)$ where $f=\sum_{i=1}^n x_{i}^2$, $-5.0\leq x_i \leq 5.0$ and $n=2$. The optimal solution for this basin function is $(v_0,\ldots,v_{n-1})=0.0$. The algorithm is an implementation based on the specification by de Castro and Von Zuben [Castro2002c].
diff --git a/docs/nature-inspired/immune/negative_selection_algorithm.html b/docs/nature-inspired/immune/negative_selection_algorithm.html index 0c07091c..7e019a11 100644 --- a/docs/nature-inspired/immune/negative_selection_algorithm.html +++ b/docs/nature-inspired/immune/negative_selection_algorithm.html @@ -109,7 +109,7 @@Procedure
Heuristics
- The Negative Selection Algorithm was designed for change detection, novelty detection, intrusion detection and similar pattern recognition and two-class classification problem domains.
-- Traditional negative selection algorithms used binary representations and binary matching rules such as Hamming distance, and $["r"]$-contiguous bits.
+- Traditional negative selection algorithms used binary representations and binary matching rules such as Hamming distance, and $r$-contiguous bits.
- A data representation should be selected that is most suitable for a given problem domain, and a matching rule is in turn selected or tailored to the data representation.
- Detectors can be prepared with no prior knowledge of the problem domain other than the known (normal or self) dataset.
- The algorithm can be configured to balance between detector convergence (quality of the matches) and the space complexity (number of detectors).
@@ -120,7 +120,7 @@Heuristics
Code Listing
Listing (below) provides an example of the Negative Selection Algorithm implemented in the Ruby Programming Language. -The demonstration problem is a two-class classification problem where samples are drawn from a two-dimensional domain, where $["x_i \\in [0,1]"]$. Those samples in $["1.0>x_i>0.5"]$ are classified as self and the rest of the space belongs to the non-self class. Samples are drawn from the self class and presented to the algorithm for the preparation of pattern detectors for classifying unobserved samples from the non-self class. +The demonstration problem is a two-class classification problem where samples are drawn from a two-dimensional domain, where $x_i \in [0,1]$. Those samples in $1.0>x_i>0.5$ are classified as self and the rest of the space belongs to the non-self class. Samples are drawn from the self class and presented to the algorithm for the preparation of pattern detectors for classifying unobserved samples from the non-self class. The algorithm creates a set of detectors that do not match the self data, and are then applied to a set of randomly generated samples from the domain. The algorithm uses a real-valued representation. The Euclidean distance function is used during matching and a minimum distance value is specified as a user parameter for approximate matches between patterns. The algorithm includes the additional computationally expensive check for duplicates in the preparation of the self dataset and the detector set.
diff --git a/docs/nature-inspired/introduction.html b/docs/nature-inspired/introduction.html index 86573f7c..94a40899 100644 --- a/docs/nature-inspired/introduction.html +++ b/docs/nature-inspired/introduction.html @@ -193,7 +193,7 @@Function Optimization
Problem Description
-Mathematically, optimization is defined as the search for a combination of parameters commonly referred to as decision variables ($["x = \\left\\{x_1, x_2, x_3, \\ldots x_n\\right\\}"]$) which minimize or maximize some ordinal quantity ($["c"]$) (typically a scalar called a score or cost) assigned by an objective function or cost function ($["f"]$), under a set of constraints ($["g = \\left\\{g_1, g_2, g_3, \\ldots g_n\\right\\}"]$). For example, a general minimization case would be as follows: $["f(x') \\leq f(x), \\forall x_i \\in x"]$. Constraints may provide boundaries on decision variables (for example in a real-value hypercube $["\\Re^n"]$), or may generally define regions of feasibility and in-feasibility in the decision variable space. In applied mathematics the field may be referred to as Mathematical Programming. More generally the field may be referred to as Global or Function Optimization given the focus on the objective function. For more general information on optimization refer to Horst et al. [Horst2000]. +Mathematically, optimization is defined as the search for a combination of parameters commonly referred to as decision variables ($x = \left{x_1, x_2, x_3, \ldots x_n\right}$) which minimize or maximize some ordinal quantity ($c$) (typically a scalar called a score or cost) assigned by an objective function or cost function ($f$), under a set of constraints ($g = \left{g_1, g_2, g_3, \ldots g_n\right}$). For example, a general minimization case would be as follows: $f(x') \leq f(x), \forall x_i \in x$. Constraints may provide boundaries on decision variables (for example in a real-value hypercube $\Re^n$), or may generally define regions of feasibility and in-feasibility in the decision variable space. In applied mathematics the field may be referred to as Mathematical Programming. More generally the field may be referred to as Global or Function Optimization given the focus on the objective function. For more general information on optimization refer to Horst et al. [Horst2000].
@@ -216,7 +216,7 @@Function Approximation
Problem Description
-Function Approximation is the problem of finding a function ($["f"]$) that approximates a target function ($["g"]$), where typically the approximated function is selected based on a sample of observations ($["x"]$, also referred to as the training set) taken from the unknown target function. +Function Approximation is the problem of finding a function ($f$) that approximates a target function ($g$), where typically the approximated function is selected based on a sample of observations ($x$, also referred to as the training set) taken from the unknown target function. In machine learning, the function approximation formalism is used to describe general problem types commonly referred to as pattern recognition, such as classification, clustering, and curve fitting (called a decision or discrimination function). Such general problem types are described in terms of approximating an unknown Probability Density Function (PDF), which underlies the relationships in the problem space, and is represented in the sample data. This perspective of such problems is commonly referred to as statistical machine learning and/or density estimation [Fukunaga1990] [Bishop1995].
@@ -288,7 +288,7 @@Inductive Learning
The method of acquiring information is called inductive learning or learning from example, where the approach uses the implicit assumption that specific examples are representative of the broader information content of the environment, specifically with regard to anticipated need. Many unconventional optimization approaches maintain a single candidate solution, a population of samples, or a compression thereof that provides both an instantaneous representation of all of the information acquired by the process, and the basis for generating and making future decisions.-This method of simultaneously acquiring and improving information from the domain and the optimization of decision making (where to direct future effort) is called the $["k"]$-armed bandit (two-armed and multi-armed bandit) problem from the field of statistical decision making known as game theory [Robbins1952] [Bergemann2006]. This formalism considers the capability of a strategy to allocate available resources proportional to the future payoff the strategy is expected to receive. The classic example is the 2-armed bandit problem used by Goldberg to describe the behavior of the genetic algorithm [Goldberg1989]. The example involves an agent that learns which one of the two slot machines provides more return by pulling the handle of each (sampling the domain) and biasing future handle pulls proportional to the expected utility, based on the probabilistic experience with the past distribution of the payoff. The formalism may also be used to understand the properties of inductive learning demonstrated by the adaptive behavior of most unconventional optimization algorithms. +This method of simultaneously acquiring and improving information from the domain and the optimization of decision making (where to direct future effort) is called the $k$-armed bandit (two-armed and multi-armed bandit) problem from the field of statistical decision making known as game theory [Robbins1952] [Bergemann2006]. This formalism considers the capability of a strategy to allocate available resources proportional to the future payoff the strategy is expected to receive. The classic example is the 2-armed bandit problem used by Goldberg to describe the behavior of the genetic algorithm [Goldberg1989]. The example involves an agent that learns which one of the two slot machines provides more return by pulling the handle of each (sampling the domain) and biasing future handle pulls proportional to the expected utility, based on the probabilistic experience with the past distribution of the payoff. The formalism may also be used to understand the properties of inductive learning demonstrated by the adaptive behavior of most unconventional optimization algorithms.
The stochastic iterative process of generate and test can be computationally wasteful, potentially re-searching areas of the problem space already searched, and requiring many trials or samples in order to achieve a 'good enough' solution. diff --git a/docs/nature-inspired/neural/backpropagation.html b/docs/nature-inspired/neural/backpropagation.html index 7a40db57..ecaf123d 100644 --- a/docs/nature-inspired/neural/backpropagation.html +++ b/docs/nature-inspired/neural/backpropagation.html @@ -67,7 +67,7 @@
Procedure
$activation = \bigg(\sum_{k=1}^{n} w_{k} \times x_{ki}\bigg) + w_{bias} \times 1.0$-where $["n"]$ is the number of weights and inputs, $["x_{ki}"]$ is the $["k^{th}"]$ attribute on the $["i^{th}"]$ input pattern, and $["w_{bias}"]$ is the bias weight. A logistic transfer function (sigmoid) is used to calculate the output for a neuron $["\\in [0,1]"]$ and provide nonlinearities between in the input and output signals: $["\\frac{1}{1+exp(-a)}"]$, where $["a"]$ represents the neuron activation. +where $n$ is the number of weights and inputs, $x_{ki}$ is the $k^{th}$ attribute on the $i^{th}$ input pattern, and $w_{bias}$ is the bias weight. A logistic transfer function (sigmoid) is used to calculate the output for a neuron $\in [0,1]$ and provide nonlinearities between in the input and output signals: $\frac{1}{1+exp(-a)}$, where $a$ represents the neuron activation.
The weight updates use the delta rule, specifically a modified delta rule where error is backwardly propagated through the network, starting at the output layer and weighted back through the previous layers. The following describes the back-propagation of error and weight updates for a single pattern. @@ -77,25 +77,25 @@
Procedure
$es_i = (c_i - o_i) \times td_i$-where $["es_i"]$ is the error signal for the $["i^{th}"]$ node, $["c_i"]$ is the expected output and $["o_i"]$ is the actual output for the $["i^{th}"]$ node. The $["td"]$ term is the derivative of the output of the $["i^{th}"]$ node. If the sigmod transfer function is used, $["td_i"]$ would be $["o_i \\times (1-o_i)"]$ For the hidden nodes, the error signal is the sum of the weighted error signals from the next layer. +where $es_i$ is the error signal for the $i^{th}$ node, $c_i$ is the expected output and $o_i$ is the actual output for the $i^{th}$ node. The $td$ term is the derivative of the output of the $i^{th}$ node. If the sigmod transfer function is used, $td_i$ would be $o_i \times (1-o_i)$ For the hidden nodes, the error signal is the sum of the weighted error signals from the next layer.
$es_i = \bigg(\sum_{k=1}^n (w_{ik} \times es_k)\bigg) \times td_i$-where $["es_i"]$ is the error signal for the $["i^{th}"]$ node, $["w_{ik}"]$ is the weight between the $["i^{th}"]$ and the $["k^{th}"]$ nodes, and $["es_k"]$ is the error signal of the $["k_th"]$ node. +where $es_i$ is the error signal for the $i^{th}$ node, $w_{ik}$ is the weight between the $i^{th}$ and the $k^{th}$ nodes, and $es_k$ is the error signal of the $k_th$ node.
The error derivatives for each weight are calculated by combining the input to each node and the error signal for the node.
$ed_i = \sum_{k=1}^n es_i \times x_k$-where $["ed_i"]$ is the error derivative for the $["i^{th}"]$ node, $["es_i"]$ is the error signal for the $["i^{th}"]$ node and $["x_k"]$ is the input from the $["k^{th}"]$ node in the previous layer. This process include the bias input that has a constant value. +where $ed_i$ is the error derivative for the $i^{th}$ node, $es_i$ is the error signal for the $i^{th}$ node and $x_k$ is the input from the $k^{th}$ node in the previous layer. This process include the bias input that has a constant value.
-Weights are updated in a direction that reduces the error derivative $["ed_i"]$ (error assigned to the weight), metered by a learning coefficient. +Weights are updated in a direction that reduces the error derivative $ed_i$ (error assigned to the weight), metered by a learning coefficient.
$w_i(t+1) = w_i(t) + (ed_k \times learn_{rate})$-where $["w_i(t+1)"]$ is the updated $["i^{th}"]$ weight, $["ed_k"]$ is the error derivative for the $["k^{th}"]$ node and $["learn_{rate}"]$ is an update coefficient parameter. +where $w_i(t+1)$ is the updated $i^{th}$ weight, $ed_k$ is the error derivative for the $k^{th}$ node and $learn_{rate}$ is an update coefficient parameter.
Input
: @@ -121,12 +121,12 @@Procedure
Heuristics
- The Back-propagation algorithm can be used to train a multi-layer network to approximate arbitrary non-linear functions and can be used for regression or classification problems.
-- Input and output values should be normalized such that $["x \\in [0,1)"]$.
+- Input and output values should be normalized such that $x \in [0,1)$.
- The weights can be updated in an online manner (after the exposure to each input pattern) or in batch (after a fixed number of patterns have been observed).
- Batch updates are expected to be more stable than online updates for some complex problems.
- A logistic (sigmoid) transfer function is commonly used to transfer the activation to a binary output value, although other transfer functions can be used such as the hyperbolic tangent (tanh), Gaussian, and softmax.
- It is good practice to expose the system to input patterns in a different random order each enumeration through the input set.
-- The initial weights are typically small random values $["\\in [0, 0.5]"]$.
+- The initial weights are typically small random values $\in [0, 0.5]$.
- Typically a small number of layers are used such as 2-4 given that the increase in layers result in an increase in the complexity of the system and the time required to train the weights.
- The learning rate can be varied during training, and it is common to introduce a momentum term to limit the rate of change.
- The weights of a given network can be initialized with a global optimization method before being refined using the Back-propagation algorithm.
diff --git a/docs/nature-inspired/neural/hopfield_network.html b/docs/nature-inspired/neural/hopfield_network.html index 26e44d63..261942fc 100644 --- a/docs/nature-inspired/neural/hopfield_network.html +++ b/docs/nature-inspired/neural/hopfield_network.html @@ -70,42 +70,42 @@Procedure
$w_{i,j} = \sum_{k=1}^{N} v_k^i\times v_k^j$-where $["w_{i,j}"]$ is the weight between neuron $["i"]$ and $["j"]$, $["N"]$ is the number of input patterns, $["v"]$ is the input pattern and $["v_k^i"]$ is the $["i^{th}"]$ attribute on the $["k^{th}"]$ input pattern. +where $w_{i,j}$ is the weight between neuron $i$ and $j$, $N$ is the number of input patterns, $v$ is the input pattern and $v_k^i$ is the $i^{th}$ attribute on the $k^{th}$ input pattern.
The propagation of the information through the network can be asynchronous where a random node is selected each iteration, or synchronously, where the output is calculated for each node before being applied to the whole network. Propagation of the information continues until no more changes are made or until a maximum number of iterations has completed, after which the output pattern from the network can be read. The activation for a single node is calculated as follows:
$n_i = \sum_{j=1}^n w_{i,j}\times n_j$-where $["n_i"]$ is the activation of the $["i^{th}"]$ neuron, $["w_{i,j}"]$ with the weight between the nodes $["i"]$ and $["j"]$, and $["n_j"]$ is the output of the $["j^{th}"]$ neuron. The activation is transferred into an output using a transfer function, typically a step function as follows: +where $n_i$ is the activation of the $i^{th}$ neuron, $w_{i,j}$ with the weight between the nodes $i$ and $j$, and $n_j$ is the output of the $j^{th}$ neuron. The activation is transferred into an output using a transfer function, typically a step function as follows:
-\[["transfer(n_i) = \\left\\{ \\begin{array}{l l} 1 & \\quad if \\geq \\theta \\\\ -1 & \\quad if < \\theta \\\\ \\end{array} \\right. "]\] +\[transfer(n_i) = \left{ \begin{array}{l l} 1 & \quad if \geq \theta \ -1 & \quad if < \theta \ \end{array} \right. \]
-where the threshold $["\\theta"]$ is typically fixed at 0. +where the threshold $\theta$ is typically fixed at 0.
Heuristics
- The Hopfield network may be used to solve the recall problem of matching cues for an input pattern to an associated pre-learned pattern.
-- The transfer function for turning the activation of a neuron into an output is typically a step function $["f(a) \\in \\{-1,1\\}"]$ (preferred), or more traditionally $["f(a) \\in \\{0,1\\}"]$.
-- The input vectors are typically normalized to boolean values $["x \\in [-1,1]"]$.
+- The transfer function for turning the activation of a neuron into an output is typically a step function $f(a) \in {-1,1}$ (preferred), or more traditionally $f(a) \in {0,1}$.
+- The input vectors are typically normalized to boolean values $x \in [-1,1]$.
- The network can be propagated asynchronously (where a random node is selected and output generated), or synchronously (where the output for all nodes are calculated before being applied).
- Weights can be learned in a one-shot or incremental method based on how much information is known about the patterns to be learned.
- All neurons in the network are typically both input and output neurons, although other network topologies have been investigated (such as the designation of input and output neurons).
-- A Hopfield network has limits on the patterns it can store and retrieve accurately from memory, described by $["N<0.15\\times n"]$ where $["N"]$ is the number of patterns that can be stored and retrieved and $["n"]$ is the number of nodes in the network.
+- A Hopfield network has limits on the patterns it can store and retrieve accurately from memory, described by $N<0.15\times n$ where $N$ is the number of patterns that can be stored and retrieved and $n$ is the number of nodes in the network.
Code Listing
Listing (below) provides an example of the Hopfield Network algorithm implemented in the Ruby Programming Language. -The problem is an instance of a recall problem where patters are described in terms of a $["3 \\times 3"]$ matrix of binary values ($["\\in \\{-1,1\\}"]$). Once the network has learned the patterns, the system is exposed to perturbed versions of the patterns (with errors introduced) and must respond with the correct pattern. Two patterns are used in this example, specifically 'T', and 'U'. +The problem is an instance of a recall problem where patters are described in terms of a $3 \times 3$ matrix of binary values ($\in {-1,1}$). Once the network has learned the patterns, the system is exposed to perturbed versions of the patterns (with errors introduced) and must respond with the correct pattern. Two patterns are used in this example, specifically 'T', and 'U'.
-The algorithm is an implementation of the Hopfield Network with a one-shot training method for the network weights, given that all patterns are already known. The information is propagated through the network using an asynchronous method, which is repeated for a fixed number of iterations. The patterns are displayed to the console during the testing of the network, with the outputs converted from $["\\{-1,1\\}"]$ to $["\\{0,1\\}"]$ for readability. +The algorithm is an implementation of the Hopfield Network with a one-shot training method for the network weights, given that all patterns are already known. The information is propagated through the network using an asynchronous method, which is repeated for a fixed number of iterations. The patterns are displayed to the console during the testing of the network, with the outputs converted from ${-1,1}$ to ${0,1}$ for readability.
def random_vector(minmax) diff --git a/docs/nature-inspired/neural/lvq.html b/docs/nature-inspired/neural/lvq.html index e5c3305a..91ea3592 100644 --- a/docs/nature-inspired/neural/lvq.html +++ b/docs/nature-inspired/neural/lvq.html @@ -68,7 +68,7 @@Procedure
$dist(x,c) = \sum_{i=1}^{n} (x_i - c_i)^2$-where $["n"]$ is the number of attributes, $["x"]$ is the input vector and $["c"]$ is a given codebook vector. +where $n$ is the number of attributes, $x$ is the input vector and $c$ is a given codebook vector.
Input
: @@ -99,7 +99,7 @@Heuristics
- Learning Vector Quantization was designed for classification problems that have existing data sets that can be used to supervise the learning by the system. The algorithm does not support regression problems.
- LVQ is non-parametric, meaning that it does not rely on assumptions about that structure of the function that it is approximating.
-- Real-values in input vectors should be normalized such that $["x \\in [0,1)"]$.
+- Real-values in input vectors should be normalized such that $x \in [0,1)$.
- Euclidean distance is commonly used to measure the distance between real-valued vectors, although other distance measures may be used (such as dot product), and data specific distance measures may be required for non-scalar attributes.
- There should be sufficient training iterations to expose all the training data to the model multiple times.
- The learning rate is typically linearly decayed over the training period from an initial value to close to zero.
@@ -111,7 +111,7 @@Heuristics
Code Listing
Listing (below) provides an example of the Learning Vector Quantization algorithm implemented in the Ruby Programming Language. -The problem is a contrived classification problem in a 2-dimensional domain $["x\\in[0,1], y\\in[0,1]"]$ with two classes: 'A' ($["x\\in[0,0.4999999], y\\in[0,0.4999999]"]$) and 'B' ($["x\\in[0.5,1], y\\in[0.5,1]"]$). +The problem is a contrived classification problem in a 2-dimensional domain $x\in[0,1], y\in[0,1]$ with two classes: 'A' ($x\in[0,0.4999999], y\in[0,0.4999999]$) and 'B' ($x\in[0.5,1], y\in[0.5,1]$).
The algorithm was implemented using the LVQ1 variant where the best matching codebook vector is located and moved toward the input vector if it is the same class, or away if the classes differ. A linear decay was used for the learning rate that was updated after each pattern was exposed to the model. The implementation can easily be extended to the other variants of the method. diff --git a/docs/nature-inspired/neural/perceptron.html b/docs/nature-inspired/neural/perceptron.html index efe9b712..87951dbd 100644 --- a/docs/nature-inspired/neural/perceptron.html +++ b/docs/nature-inspired/neural/perceptron.html @@ -65,11 +65,11 @@
Procedure
$activation \leftarrow \sum_{k=1}^{n}\big( w_{k} \times x_{ki}\big) + w_{bias} \times 1.0$-where $["n"]$ is the number of weights and inputs, $["x_{ki}"]$ is the $["k^{th}"]$ attribute on the $["i^{th}"]$ input pattern, and $["w_{bias}"]$ is the bias weight. The weights are updated as follows: +where $n$ is the number of weights and inputs, $x_{ki}$ is the $k^{th}$ attribute on the $i^{th}$ input pattern, and $w_{bias}$ is the bias weight. The weights are updated as follows:
$w_{i}(t+1) = w_{i}(t) + \alpha \times (e(t)-a(t)) \times x_{i}(t)$-where $["w_i"]$ is the $["i^{th}"]$ weight at time $["t"]$ and $["t+1"]$, $["\\alpha"]$ is the learning rate, $["e(t)"]$ and $["a(t)"]$ are the expected and actual output at time $["t"]$, and $["x_i"]$ is the $["i^{th}"]$ input. This update process is applied to each weight in turn (as well as the bias weight with its contact input). +where $w_i$ is the $i^{th}$ weight at time $t$ and $t+1$, $\alpha$ is the learning rate, $e(t)$ and $a(t)$ are the expected and actual output at time $t$, and $x_i$ is the $i^{th}$ input. This update process is applied to each weight in turn (as well as the bias weight with its contact input).
Input
: @@ -95,14 +95,14 @@Heuristics
@@ -112,7 +112,7 @@
- The Perceptron can be used to approximate arbitrary linear functions and can be used for regression or classification problems.
- The Perceptron cannot learn a non-linear mapping between the input and output attributes. The XOR problem is a classical example of a problem that the Perceptron cannot learn.
-- Input and output values should be normalized such that $["x \\in [0,1)"]$.
-- The learning rate ($["\\alpha \\in [0,1]"]$) controls the amount of change each error has on the system, lower learning rages are common such as 0.1.
+- Input and output values should be normalized such that $x \in [0,1)$.
+- The learning rate ($\alpha \in [0,1]$) controls the amount of change each error has on the system, lower learning rages are common such as 0.1.
- The weights can be updated in an online manner (after the exposure to each input pattern) or in batch (after a fixed number of patterns have been observed).
- Batch updates are expected to be more stable than online updates for some complex problems.
- A bias weight is used with a constant input signal to provide stability to the learning process.
-- A step transfer function is commonly used to transfer the activation to a binary output value $["1 \\leftarrow activation \\geq 0"]$, otherwise $["0"]$.
+- A step transfer function is commonly used to transfer the activation to a binary output value $1 \leftarrow activation \geq 0$, otherwise $0$.
- It is good practice to expose the system to input patterns in a different random order each enumeration through the input set.
-- The initial weights are typically small random values, typically $["\\in [0, 0.5]"]$.
+- The initial weights are typically small random values, typically $\in [0, 0.5]$.
Code Listing
The problem is the classical OR boolean problem, where the inputs of the boolean truth table are provided as the two inputs and the result of the boolean OR operation is expected as output.-The algorithm was implemented using an online learning method, meaning the weights are updated after each input pattern is observed. A step transfer function is used to convert the activation into a binary output $["\\in\\{0,1\\}"]$. Random samples are taken from the domain to train the weights, and similarly, random samples are drawn from the domain to demonstrate what the network has learned. A bias weight is used for stability with a constant input of 1.0. +The algorithm was implemented using an online learning method, meaning the weights are updated after each input pattern is observed. A step transfer function is used to convert the activation into a binary output $\in{0,1}$. Random samples are taken from the domain to train the weights, and similarly, random samples are drawn from the domain to demonstrate what the network has learned. A bias weight is used for stability with a constant input of 1.0.
def random_vector(minmax) diff --git a/docs/nature-inspired/neural/som.html b/docs/nature-inspired/neural/som.html index 7886300b..1e1a76a2 100644 --- a/docs/nature-inspired/neural/som.html +++ b/docs/nature-inspired/neural/som.html @@ -68,14 +68,14 @@Procedure
$dist(x,c) = \sum_{i=1}^{n} (x_i - c_i)^2$-where $["n"]$ is the number of attributes, $["x"]$ is the input vector and $["c"]$ is a given codebook vector. +where $n$ is the number of attributes, $x$ is the input vector and $c$ is a given codebook vector.
The neighbors of the BMU in the topological structure of the network are selected using a neighborhood size that is linearly decreased during the training of the network. The BMU and all selected neighbors are then adjusted toward the input vector using a learning rate that too is decreased linearly with the training cycles:
$c_i(t+1) = learn_{rate}(t) \times (c_i(t) - x_i)$-where $["c_i(t)"]$ is the $["i^{th}"]$ attribute of a codebook vector at time $["t"]$, $["learn_{rate}"]$ is the current learning rate, an $["x_i"]$ is the $["i^{th}"]$ attribute of a input vector. +where $c_i(t)$ is the $i^{th}$ attribute of a codebook vector at time $t$, $learn_{rate}$ is the current learning rate, an $x_i$ is the $i^{th}$ attribute of a input vector.
The neighborhood is typically square (called bubble) where all neighborhood nodes are updated using the same learning rate for the iteration, or Gaussian where the learning rate is proportional to the neighborhood distance using a Gaussian distribution (neighbors further away from the BMU are updated less). @@ -111,7 +111,7 @@
Heuristics
- The Self-Organizing Map was designed for unsupervised learning problems such as feature extraction, visualization and clustering. Some extensions of the approach can label the prepared codebook vectors which can be used for classification.
- SOM is non-parametric, meaning that it does not rely on assumptions about that structure of the function that it is approximating.
-- Real-values in input vectors should be normalized such that $["x \\in [0,1)"]$.
+- Real-values in input vectors should be normalized such that $x \in [0,1)$.
- Euclidean distance is commonly used to measure the distance between real-valued vectors, although other distance measures may be used (such as dot product), and data specific distance measures may be required for non-scalar attributes.
- There should be sufficient training iterations to expose all the training data to the model multiple times.
- The more complex the class distribution, the more codebook vectors that will be required, some problems may need thousands.
@@ -126,10 +126,10 @@Heuristics
Code Listing
Listing (below) provides an example of the Self-Organizing Map algorithm implemented in the Ruby Programming Language. -The problem is a feature detection problem, where the network is expected to learn a predefined shape based on being exposed to samples in the domain. The domain is two-dimensional $["x,y \\in [0,1]"]$, where a shape is pre-defined as a square in the middle of the domain $["x,y \\in [0.3,0.6]"]$. The system is initialized to vectors within the domain although is only exposed to samples within the pre-defined shape during training. The expectation is that the system will model the shape based on the observed samples. +The problem is a feature detection problem, where the network is expected to learn a predefined shape based on being exposed to samples in the domain. The domain is two-dimensional $x,y \in [0,1]$, where a shape is pre-defined as a square in the middle of the domain $x,y \in [0.3,0.6]$. The system is initialized to vectors within the domain although is only exposed to samples within the pre-defined shape during training. The expectation is that the system will model the shape based on the observed samples.
-The algorithm is an implementation of the basic Self-Organizing Map algorithm based on the description in Chapter 3 of the seminal book on the technique [Kohonen1995]. The implementation is configured with a $["4 \\times 5"]$ grid of nodes, the Euclidean distance measure is used to determine the BMU and neighbors, a Bubble neighborhood function is used. Error rates are presented to the console, and the codebook vectors themselves are described before and after training. The learning process is incremental rather than batch, for simplicity. +The algorithm is an implementation of the basic Self-Organizing Map algorithm based on the description in Chapter 3 of the seminal book on the technique [Kohonen1995]. The implementation is configured with a $4 \times 5$ grid of nodes, the Euclidean distance measure is used to determine the BMU and neighbors, a Bubble neighborhood function is used. Error rates are presented to the console, and the codebook vectors themselves are described before and after training. The learning process is incremental rather than batch, for simplicity.
An extension to this implementation would be to visualize the resulting network structure in the domain - shrinking from a mesh that covers the whole domain, down to a mesh that only covers the pre-defined shape within the domain. diff --git a/docs/nature-inspired/physical/cultural_algorithm.html b/docs/nature-inspired/physical/cultural_algorithm.html index de83c351..5eb19f2d 100644 --- a/docs/nature-inspired/physical/cultural_algorithm.html +++ b/docs/nature-inspired/physical/cultural_algorithm.html @@ -105,7 +105,7 @@
Heuristics
Code Listing
Listing (below) provides an example of the Cultural Algorithm implemented in the Ruby Programming Language. -The demonstration problem is an instance of a continuous function optimization that seeks $["\\min f(x)"]$ where $["f=\\sum_{i=1}^n x_{i}^2"]$, $["-5.0\\leq x_i \\leq 5.0"]$ and $["n=2"]$. The optimal solution for this basin function is $["(v_0,\\ldots,v_{n-1})=0.0"]$. +The demonstration problem is an instance of a continuous function optimization that seeks $\min f(x)$ where $f=\sum_{i=1}^n x_{i}^2$, $-5.0\leq x_i \leq 5.0$ and $n=2$. The optimal solution for this basin function is $(v_0,\ldots,v_{n-1})=0.0$.
The Cultural Algorithm was implemented based on the description of the Cultural Algorithm Evolutionary Program (CAEP) presented by Reynolds [Reynolds1999]. diff --git a/docs/nature-inspired/physical/extremal_optimization.html b/docs/nature-inspired/physical/extremal_optimization.html index e6a35492..53670f7c 100644 --- a/docs/nature-inspired/physical/extremal_optimization.html +++ b/docs/nature-inspired/physical/extremal_optimization.html @@ -64,7 +64,7 @@
Strategy
Procedure
-Algorithm (below) provides a pseudocode listing of the Extremal Optimization algorithm for minimizing a cost function. The deterministic selection of the worst component in the
SelectWeakComponent
function and replacement in theSelectReplacementComponent
function is classical EO. If these decisions are probabilistic making use of $["\\tau"]$ parameter, this is referred to as $["\\tau"]$-Extremal Optimization. +Algorithm (below) provides a pseudocode listing of the Extremal Optimization algorithm for minimizing a cost function. The deterministic selection of the worst component in theSelectWeakComponent
function and replacement in theSelectReplacementComponent
function is classical EO. If these decisions are probabilistic making use of $\tau$ parameter, this is referred to as $\tau$-Extremal Optimization.Input
: @@ -96,9 +96,9 @@Procedure
Heuristics
@@ -108,7 +108,7 @@
- Extremal Optimization was designed for combinatorial optimization problems, although variations have been applied to continuous function optimization.
-- The selection of the worst component and the replacement component each iteration can be deterministic or probabilistic, the latter of which is referred to as $["\\tau"]$-Extremal Optimization given the use of a $["\\tau"]$ parameter.
+- The selection of the worst component and the replacement component each iteration can be deterministic or probabilistic, the latter of which is referred to as $\tau$-Extremal Optimization given the use of a $\tau$ parameter.
- The selection of an appropriate scoring function of the components of a solution is the most difficult part in the application of the technique.
-- For $["\\tau"]$-Extremal Optimization, low $["\\tau"]$ values are used (such as $["\\tau \\in [1.2,1.6]"]$) have been found to be effective for the TSP.
+- For $\tau$-Extremal Optimization, low $\tau$ values are used (such as $\tau \in [1.2,1.6]$) have been found to be effective for the TSP.
Code Listing
The algorithm is applied to the Berlin52 instance of the Traveling Salesman Problem (TSP), taken from the TSPLIB. The problem seeks a permutation of the order to visit cities (called a tour) that minimizes the total distance traveled. The optimal tour distance for Berlin52 instance is 7542 units.-The algorithm implementation is based on the seminal work by Boettcher and Percus [Boettcher1999]. A solution is comprised of a permutation of city components. Each city can potentially form a connection to any other city, and the connections to other cities ordered by distance may be considered its neighborhood. For a given candidate solution, the city components of a solution are scored based on the neighborhood rank of the cities to which they are connected: $["fitness_k \\leftarrow \\frac{3}{r_i + r_j}"]$, where $["r_i"]$ and $["r_j"]$ are the neighborhood ranks of cities $["i"]$ and $["j"]$ against city $["k"]$. A city is selected for modification probabilistically where the probability of selecting a given city is proportional to $["n_i^{-\\tau}"]$, where $["n"]$ is the rank of city $["i"]$. The longest connection is broken, and the city is connected with another neighboring city that is also probabilistically selected. +The algorithm implementation is based on the seminal work by Boettcher and Percus [Boettcher1999]. A solution is comprised of a permutation of city components. Each city can potentially form a connection to any other city, and the connections to other cities ordered by distance may be considered its neighborhood. For a given candidate solution, the city components of a solution are scored based on the neighborhood rank of the cities to which they are connected: $fitness_k \leftarrow \frac{3}{r_i + r_j}$, where $r_i$ and $r_j$ are the neighborhood ranks of cities $i$ and $j$ against city $k$. A city is selected for modification probabilistically where the probability of selecting a given city is proportional to $n_i^{-\tau}$, where $n$ is the rank of city $i$. The longest connection is broken, and the city is connected with another neighboring city that is also probabilistically selected.
def euc_2d(c1, c2) diff --git a/docs/nature-inspired/physical/harmony_search.html b/docs/nature-inspired/physical/harmony_search.html index 23cb36e6..332ad5b7 100644 --- a/docs/nature-inspired/physical/harmony_search.html +++ b/docs/nature-inspired/physical/harmony_search.html @@ -67,7 +67,7 @@Procedure
$x' \leftarrow x + range \times \epsilon$-where $["range"]$ is a the user parameter (pitch bandwidth) to control the size of the changes, and $["\\epsilon"]$ is a uniformly random number $["\\in [-1,1]"]$. +where $range$ is a the user parameter (pitch bandwidth) to control the size of the changes, and $\epsilon$ is a uniformly random number $\in [-1,1]$.
Input
: @@ -106,8 +106,8 @@Procedure
Heuristics
- Harmony Search was designed as a generalized optimization method for continuous, discrete, and constrained optimization and has been applied to numerous types of optimization problems.
-- The harmony memory considering rate (HMCR) $["\\in [0,1]"]$ controls the use of information from the harmony memory or the generation of a random pitch. As such, it controls the rate of convergence of the algorithm and is typically configured $["\\in [0.7,0.95]"]$.
-- The pitch adjustment rate (PAR) $["\\in [0,1]"]$ controls the frequency of adjustment of pitches selected from harmony memory, typically configured $["\\in [0.1,0.5]"]$. High values can result in the premature convergence of the search.
+- The harmony memory considering rate (HMCR) $\in [0,1]$ controls the use of information from the harmony memory or the generation of a random pitch. As such, it controls the rate of convergence of the algorithm and is typically configured $\in [0.7,0.95]$.
+- The pitch adjustment rate (PAR) $\in [0,1]$ controls the frequency of adjustment of pitches selected from harmony memory, typically configured $\in [0.1,0.5]$. High values can result in the premature convergence of the search.
- The pitch adjustment rate and the adjustment method (amount of adjustment or fret width) are typically fixed, having a linear effect through time. Non-linear methods have been considered, for example refer to Geem [Geem2010a].
- When creating a new harmony, aggregations of pitches can be taken from across musicians in the harmony memory.
- The harmony memory update is typically a greedy process, although other considerations such as diversity may be used where the most similar harmony is replaced.
@@ -117,7 +117,7 @@Heuristics
Code Listing
Listing (below) provides an example of the Harmony Search algorithm implemented in the Ruby Programming Language. -The demonstration problem is an instance of a continuous function optimization that seeks $["min f(x)"]$ where $["f=\\sum_{i=1}^n x_{i}^2"]$, $["-5.0\\leq x_i \\leq 5.0"]$ and $["n=3"]$. The optimal solution for this basin function is $["(v_0,\\ldots,v_{n-1})=0.0"]$. +The demonstration problem is an instance of a continuous function optimization that seeks $min f(x)$ where $f=\sum_{i=1}^n x_{i}^2$, $-5.0\leq x_i \leq 5.0$ and $n=3$. The optimal solution for this basin function is $(v_0,\ldots,v_{n-1})=0.0$. The algorithm implementation and parameterization are based on the description by Yang [Yang2009], with refinement from Geem [Geem2010a].
diff --git a/docs/nature-inspired/physical/memetic_algorithm.html b/docs/nature-inspired/physical/memetic_algorithm.html index ebc4d85a..7fe779dd 100644 --- a/docs/nature-inspired/physical/memetic_algorithm.html +++ b/docs/nature-inspired/physical/memetic_algorithm.html @@ -102,7 +102,7 @@Heuristics
Code Listing
Listing (below) provides an example of the Memetic Algorithm implemented in the Ruby Programming Language. -The demonstration problem is an instance of a continuous function optimization that seeks $["\\min f(x)"]$ where $["f=\\sum_{i=1}^n x_{i}^2"]$, $["-5.0\\leq x_i \\leq 5.0"]$ and $["n=3"]$. The optimal solution for this basin function is $["(v_0,\\ldots,v_{n-1})=0.0"]$. +The demonstration problem is an instance of a continuous function optimization that seeks $\min f(x)$ where $f=\sum_{i=1}^n x_{i}^2$, $-5.0\leq x_i \leq 5.0$ and $n=3$. The optimal solution for this basin function is $(v_0,\ldots,v_{n-1})=0.0$. The Memetic Algorithm uses a canonical Genetic Algorithm as the global search technique that operates on binary strings, uses tournament selection, point mutations, uniform crossover and a binary coded decimal decoding of bits to real values. A bit climber local search is used that performs probabilistic bit flips (point mutations) and only accepts solutions with the same or improving fitness.
diff --git a/docs/nature-inspired/physical/simulated_annealing.html b/docs/nature-inspired/physical/simulated_annealing.html index 4f94ca7e..fb271631 100644 --- a/docs/nature-inspired/physical/simulated_annealing.html +++ b/docs/nature-inspired/physical/simulated_annealing.html @@ -98,7 +98,7 @@Heuristics
- The convergence proof suggests that with a long enough cooling period, the system will always converge to the global optimum. The downside of this theoretical finding is that the number of samples taken for optimum convergence to occur on some problems may be more than a complete enumeration of the search space.
- Performance improvements can be given with the selection of a candidate move generation scheme (neighborhood) that is less likely to generate candidates of significantly higher cost.
- Restarting the cooling schedule using the best found solution so far can lead to an improved outcome on some problems.
-- A common acceptance method is to always accept improving solutions and accept worse solutions with a probability of $["P(accept) \\leftarrow \\exp(\\frac{e-e'}{T})"]$, where $["T"]$ is the current temperature, $["e"]$ is the energy (or cost) of the current solution and $["e'"]$ is the energy of a candidate solution being considered.
+- A common acceptance method is to always accept improving solutions and accept worse solutions with a probability of $P(accept) \leftarrow \exp(\frac{e-e'}{T})$, where $T$ is the current temperature, $e$ is the energy (or cost) of the current solution and $e'$ is the energy of a candidate solution being considered.
- The size of the neighborhood considered in generating candidate solutions may also change over time or be influenced by the temperature, starting initially broad and narrowing with the execution of the algorithm.
- A problem specific heuristic method can be used to provide the starting point for the search.
@@ -110,7 +110,7 @@Code Listing
The algorithm is applied to the Berlin52 instance of the Traveling Salesman Problem (TSP), taken from the TSPLIB. The problem seeks a permutation of the order to visit cities (called a tour) that minimizes the total distance traveled. The optimal tour distance for Berlin52 instance is 7542 units.-The algorithm implementation uses a two-opt procedure for the neighborhood function and the classical $["P(accept) \\leftarrow \\exp(\\frac{e-e'}{T})"]$ as the acceptance function. A simple linear cooling regime is used with a large initial temperature which is decreased each iteration. +The algorithm implementation uses a two-opt procedure for the neighborhood function and the classical $P(accept) \leftarrow \exp(\frac{e-e'}{T})$ as the acceptance function. A simple linear cooling regime is used with a large initial temperature which is decreased each iteration.
def euc_2d(c1, c2) diff --git a/docs/nature-inspired/probabilistic/compact_genetic_algorithm.html b/docs/nature-inspired/probabilistic/compact_genetic_algorithm.html index a4559fd7..83afba81 100644 --- a/docs/nature-inspired/probabilistic/compact_genetic_algorithm.html +++ b/docs/nature-inspired/probabilistic/compact_genetic_algorithm.html @@ -59,7 +59,7 @@Strategy
Procedure
The Compact Genetic Algorithm maintains a real-valued prototype vector that represents the probability of each component being expressed in a candidate solution. -Algorithm (below) provides a pseudocode listing of the Compact Genetic Algorithm for maximizing a cost function. The parameter $["n"]$ indicates the amount to update probabilities for conflicting bits in each algorithm iteration. +Algorithm (below) provides a pseudocode listing of the Compact Genetic Algorithm for maximizing a cost function. The parameter $n$ indicates the amount to update probabilities for conflicting bits in each algorithm iteration.
Input
: @@ -95,10 +95,10 @@Procedure
Heuristics
-
diff --git a/docs/nature-inspired/probabilistic/cross_entropy.html b/docs/nature-inspired/probabilistic/cross_entropy.html index dd610d9b..46ccdc20 100644 --- a/docs/nature-inspired/probabilistic/cross_entropy.html +++ b/docs/nature-inspired/probabilistic/cross_entropy.html @@ -95,15 +95,15 @@- The vector update parameter ($["n"]$) influences the amount that the probabilities are updated each algorithm iteration.
-- The vector update parameter ($["n"]$) may be considered to be comparable to the population size parameter in the Genetic Algorithm.
+- The vector update parameter ($n$) influences the amount that the probabilities are updated each algorithm iteration.
+- The vector update parameter ($n$) may be considered to be comparable to the population size parameter in the Genetic Algorithm.
- Early results demonstrate that the cGA may be comparable to a standard Genetic Algorithm on classical binary string optimization problems (such as OneMax).
-- The algorithm may be considered to have converged if the vector probabilities are all either $["0"]$ or $["1"]$.
+- The algorithm may be considered to have converged if the vector probabilities are all either $0$ or $1$.
Procedure
Heuristics
- The Cross-Entropy Method was adapted for combinatorial optimization problems, although has been applied to continuous function optimization as well as noisy simulation problems.
-- A alpha ($["\\alpha"]$) parameter or learning rate $["\\in [0.1]"]$ is typically set high, such as 0.7.
-- A smoothing function can be used to further control the updates the summaries of the distribution(s) of samples from the problem space. For example, in continuous function optimization a $["\\beta"]$ parameter may replace $["\\alpha"]$ for updating the standard deviation, calculated at time $["t"]$ as $["\\beta_{t} = \\beta - \\beta \\times (1-\\frac{1}{t})^q"]$, where $["\\beta"]$ is initially set high $["\\in [0.8, 0.99]"]$ and $["q"]$ is a small integer $["\\in [5, 10]"]$.
+- A alpha ($\alpha$) parameter or learning rate $\in [0.1]$ is typically set high, such as 0.7.
+- A smoothing function can be used to further control the updates the summaries of the distribution(s) of samples from the problem space. For example, in continuous function optimization a $\beta$ parameter may replace $\alpha$ for updating the standard deviation, calculated at time $t$ as $\beta_{t} = \beta - \beta \times (1-\frac{1}{t})^q$, where $\beta$ is initially set high $\in [0.8, 0.99]$ and $q$ is a small integer $\in [5, 10]$.
Code Listing
Listing (below) provides an example of the Cross-Entropy Method algorithm implemented in the Ruby Programming Language. -The demonstration problem is an instance of a continuous function optimization problem that seeks $["\\min f(x)"]$ where $["f=\\sum_{i=1}^n x_{i}^2"]$, $["-5.0\\leq x_i \\leq 5.0"]$ and $["n=3"]$. The optimal solution for this basin function is $["(v_0,\\ldots,v_{n-1})=0.0"]$. +The demonstration problem is an instance of a continuous function optimization problem that seeks $\min f(x)$ where $f=\sum_{i=1}^n x_{i}^2$, $-5.0\leq x_i \leq 5.0$ and $n=3$. The optimal solution for this basin function is $(v_0,\ldots,v_{n-1})=0.0$.
The algorithm was implemented based on a description of the Cross-Entropy Method algorithm for continuous function optimization by Rubinstein and Kroese in Chapter 5 and Appendix A of their book on the method [Rubinstein2004]. The algorithm maintains means and standard deviations of the distribution of samples for convenience. The means and standard deviations are initialized based on random positions in the problem space and the bounds of the whole problem space respectively. A smoothing parameter is not used on the standard deviations. diff --git a/docs/nature-inspired/sitemap.xml b/docs/nature-inspired/sitemap.xml index 5037e390..2b15e777 100644 --- a/docs/nature-inspired/sitemap.xml +++ b/docs/nature-inspired/sitemap.xml @@ -1,204 +1,204 @@
diff --git a/docs/nature-inspired/stochastic/adaptive_random_search.html b/docs/nature-inspired/stochastic/adaptive_random_search.html index b0b86fcf..3a01ac86 100644 --- a/docs/nature-inspired/stochastic/adaptive_random_search.html +++ b/docs/nature-inspired/stochastic/adaptive_random_search.html @@ -109,7 +109,7 @@ - http://www.cleveralgorithms.com/nature-inspired/evolution.html +http://cleveralgorithms.com/nature-inspired/evolution.html - http://www.cleveralgorithms.com/nature-inspired/advanced/racing_algorithms.html +http://cleveralgorithms.com/nature-inspired/advanced/racing_algorithms.html - http://www.cleveralgorithms.com/nature-inspired/advanced/paradigms.html +http://cleveralgorithms.com/nature-inspired/advanced/paradigms.html - http://www.cleveralgorithms.com/nature-inspired/advanced/problem_solving.html +http://cleveralgorithms.com/nature-inspired/advanced/problem_solving.html - http://www.cleveralgorithms.com/nature-inspired/advanced/new_algorithms.html +http://cleveralgorithms.com/nature-inspired/advanced/new_algorithms.html - http://www.cleveralgorithms.com/nature-inspired/advanced/testing_algorithms.html +http://cleveralgorithms.com/nature-inspired/advanced/testing_algorithms.html - http://www.cleveralgorithms.com/nature-inspired/advanced/visualizing_algorithms.html +http://cleveralgorithms.com/nature-inspired/advanced/visualizing_algorithms.html - http://www.cleveralgorithms.com/nature-inspired/swarm/bees_algorithm.html +http://cleveralgorithms.com/nature-inspired/swarm/bees_algorithm.html - http://www.cleveralgorithms.com/nature-inspired/swarm/ant_system.html +http://cleveralgorithms.com/nature-inspired/swarm/ant_system.html - http://www.cleveralgorithms.com/nature-inspired/swarm/bfoa.html +http://cleveralgorithms.com/nature-inspired/swarm/bfoa.html - http://www.cleveralgorithms.com/nature-inspired/swarm/pso.html +http://cleveralgorithms.com/nature-inspired/swarm/pso.html - http://www.cleveralgorithms.com/nature-inspired/swarm/ant_colony_system.html +http://cleveralgorithms.com/nature-inspired/swarm/ant_colony_system.html - http://www.cleveralgorithms.com/nature-inspired/swarm.html +http://cleveralgorithms.com/nature-inspired/swarm.html - http://www.cleveralgorithms.com/nature-inspired/copyright.html +http://cleveralgorithms.com/nature-inspired/copyright.html - http://www.cleveralgorithms.com/nature-inspired/index.html +http://cleveralgorithms.com/nature-inspired/index.html - http://www.cleveralgorithms.com/nature-inspired/physical.html +http://cleveralgorithms.com/nature-inspired/physical.html - http://www.cleveralgorithms.com/nature-inspired/probabilistic/compact_genetic_algorithm.html +http://cleveralgorithms.com/nature-inspired/probabilistic/compact_genetic_algorithm.html - http://www.cleveralgorithms.com/nature-inspired/probabilistic/umda.html +http://cleveralgorithms.com/nature-inspired/probabilistic/umda.html - http://www.cleveralgorithms.com/nature-inspired/probabilistic/cross_entropy.html +http://cleveralgorithms.com/nature-inspired/probabilistic/cross_entropy.html - http://www.cleveralgorithms.com/nature-inspired/probabilistic/boa.html +http://cleveralgorithms.com/nature-inspired/probabilistic/boa.html - http://www.cleveralgorithms.com/nature-inspired/probabilistic/pbil.html +http://cleveralgorithms.com/nature-inspired/probabilistic/pbil.html - http://www.cleveralgorithms.com/nature-inspired/physical/simulated_annealing.html +http://cleveralgorithms.com/nature-inspired/physical/simulated_annealing.html - http://www.cleveralgorithms.com/nature-inspired/physical/memetic_algorithm.html +http://cleveralgorithms.com/nature-inspired/physical/memetic_algorithm.html - http://www.cleveralgorithms.com/nature-inspired/physical/cultural_algorithm.html +http://cleveralgorithms.com/nature-inspired/physical/cultural_algorithm.html - http://www.cleveralgorithms.com/nature-inspired/physical/harmony_search.html +http://cleveralgorithms.com/nature-inspired/physical/harmony_search.html - http://www.cleveralgorithms.com/nature-inspired/physical/extremal_optimization.html +http://cleveralgorithms.com/nature-inspired/physical/extremal_optimization.html - http://www.cleveralgorithms.com/nature-inspired/stochastic/reactive_tabu_search.html +http://cleveralgorithms.com/nature-inspired/stochastic/reactive_tabu_search.html - http://www.cleveralgorithms.com/nature-inspired/stochastic/grasp.html +http://cleveralgorithms.com/nature-inspired/stochastic/grasp.html - http://www.cleveralgorithms.com/nature-inspired/stochastic/guided_local_search.html +http://cleveralgorithms.com/nature-inspired/stochastic/guided_local_search.html - http://www.cleveralgorithms.com/nature-inspired/stochastic/scatter_search.html +http://cleveralgorithms.com/nature-inspired/stochastic/scatter_search.html - http://www.cleveralgorithms.com/nature-inspired/stochastic/random_search.html +http://cleveralgorithms.com/nature-inspired/stochastic/random_search.html - http://www.cleveralgorithms.com/nature-inspired/stochastic/tabu_search.html +http://cleveralgorithms.com/nature-inspired/stochastic/tabu_search.html - http://www.cleveralgorithms.com/nature-inspired/stochastic/hill_climbing_search.html +http://cleveralgorithms.com/nature-inspired/stochastic/hill_climbing_search.html - http://www.cleveralgorithms.com/nature-inspired/stochastic/adaptive_random_search.html +http://cleveralgorithms.com/nature-inspired/stochastic/adaptive_random_search.html - http://www.cleveralgorithms.com/nature-inspired/stochastic/iterated_local_search.html +http://cleveralgorithms.com/nature-inspired/stochastic/iterated_local_search.html - http://www.cleveralgorithms.com/nature-inspired/stochastic/variable_neighborhood_search.html +http://cleveralgorithms.com/nature-inspired/stochastic/variable_neighborhood_search.html - http://www.cleveralgorithms.com/nature-inspired/immune.html +http://cleveralgorithms.com/nature-inspired/immune.html - http://www.cleveralgorithms.com/nature-inspired/neural.html +http://cleveralgorithms.com/nature-inspired/neural.html - http://www.cleveralgorithms.com/nature-inspired/immune/clonal_selection_algorithm.html +http://cleveralgorithms.com/nature-inspired/immune/clonal_selection_algorithm.html - http://www.cleveralgorithms.com/nature-inspired/immune/negative_selection_algorithm.html +http://cleveralgorithms.com/nature-inspired/immune/negative_selection_algorithm.html - http://www.cleveralgorithms.com/nature-inspired/immune/dca.html +http://cleveralgorithms.com/nature-inspired/immune/dca.html - http://www.cleveralgorithms.com/nature-inspired/immune/immune_network_algorithm.html +http://cleveralgorithms.com/nature-inspired/immune/immune_network_algorithm.html - http://www.cleveralgorithms.com/nature-inspired/immune/airs.html +http://cleveralgorithms.com/nature-inspired/immune/airs.html - http://www.cleveralgorithms.com/nature-inspired/acknowledgments.html +http://cleveralgorithms.com/nature-inspired/acknowledgments.html - http://www.cleveralgorithms.com/nature-inspired/advanced.html +http://cleveralgorithms.com/nature-inspired/advanced.html - http://www.cleveralgorithms.com/nature-inspired/evolution/grammatical_evolution.html +http://cleveralgorithms.com/nature-inspired/evolution/grammatical_evolution.html - http://www.cleveralgorithms.com/nature-inspired/evolution/learning_classifier_system.html +http://cleveralgorithms.com/nature-inspired/evolution/learning_classifier_system.html - http://www.cleveralgorithms.com/nature-inspired/evolution/spea.html +http://cleveralgorithms.com/nature-inspired/evolution/spea.html - http://www.cleveralgorithms.com/nature-inspired/evolution/differential_evolution.html +http://cleveralgorithms.com/nature-inspired/evolution/differential_evolution.html - http://www.cleveralgorithms.com/nature-inspired/evolution/evolutionary_programming.html +http://cleveralgorithms.com/nature-inspired/evolution/evolutionary_programming.html - http://www.cleveralgorithms.com/nature-inspired/evolution/genetic_algorithm.html +http://cleveralgorithms.com/nature-inspired/evolution/genetic_algorithm.html - http://www.cleveralgorithms.com/nature-inspired/evolution/nsga.html +http://cleveralgorithms.com/nature-inspired/evolution/nsga.html - http://www.cleveralgorithms.com/nature-inspired/evolution/gene_expression_programming.html +http://cleveralgorithms.com/nature-inspired/evolution/gene_expression_programming.html - http://www.cleveralgorithms.com/nature-inspired/evolution/evolution_strategies.html +http://cleveralgorithms.com/nature-inspired/evolution/evolution_strategies.html - http://www.cleveralgorithms.com/nature-inspired/evolution/genetic_programming.html +http://cleveralgorithms.com/nature-inspired/evolution/genetic_programming.html - http://www.cleveralgorithms.com/nature-inspired/errata.html +http://cleveralgorithms.com/nature-inspired/errata.html - http://www.cleveralgorithms.com/nature-inspired/probabilistic.html +http://cleveralgorithms.com/nature-inspired/probabilistic.html - http://www.cleveralgorithms.com/nature-inspired/preface.html +http://cleveralgorithms.com/nature-inspired/preface.html - http://www.cleveralgorithms.com/nature-inspired/foreword.html +http://cleveralgorithms.com/nature-inspired/foreword.html - http://www.cleveralgorithms.com/nature-inspired/neural/som.html +http://cleveralgorithms.com/nature-inspired/neural/som.html - http://www.cleveralgorithms.com/nature-inspired/neural/lvq.html +http://cleveralgorithms.com/nature-inspired/neural/lvq.html - http://www.cleveralgorithms.com/nature-inspired/neural/perceptron.html +http://cleveralgorithms.com/nature-inspired/neural/perceptron.html - http://www.cleveralgorithms.com/nature-inspired/neural/hopfield_network.html +http://cleveralgorithms.com/nature-inspired/neural/hopfield_network.html - http://www.cleveralgorithms.com/nature-inspired/neural/backpropagation.html +http://cleveralgorithms.com/nature-inspired/neural/backpropagation.html - http://www.cleveralgorithms.com/nature-inspired/introduction.html +http://cleveralgorithms.com/nature-inspired/introduction.html - http://www.cleveralgorithms.com/nature-inspired/appendix1.html +http://cleveralgorithms.com/nature-inspired/appendix1.html - http://www.cleveralgorithms.com/nature-inspired/stochastic.html +http://cleveralgorithms.com/nature-inspired/stochastic.html Code Listing
Listing (below) provides an example of the Adaptive Random Search Algorithm implemented in the Ruby Programming Language, based on the specification for 'Adaptive Step-Size Random Search' by Schummer and Steiglitz [Schumer1968]. In the example, the algorithm runs for a fixed number of iterations and returns the best candidate solution discovered. -The example problem is an instance of a continuous function optimization that seeks $["\\min f(x)"]$ where $["f=\\sum_{i=1}^n x_{i}^2"]$, $["-5.0 < x_i < 5.0"]$ and $["n=2"]$. The optimal solution for this basin function is $["(v_0,\\ldots,v_{n-1})=0.0"]$. +The example problem is an instance of a continuous function optimization that seeks $\min f(x)$ where $f=\sum_{i=1}^n x_{i}^2$, $-5.0 < x_i < 5.0$ and $n=2$. The optimal solution for this basin function is $(v_0,\ldots,v_{n-1})=0.0$.
def objective_function(vector) diff --git a/docs/nature-inspired/stochastic/grasp.html b/docs/nature-inspired/stochastic/grasp.html index 9f3c1835..b16508be 100644 --- a/docs/nature-inspired/stochastic/grasp.html +++ b/docs/nature-inspired/stochastic/grasp.html @@ -73,7 +73,7 @@Procedure
-Algorithm (below) provides the pseudocode the Greedy Randomized Construction function. The function involves the step-wise construction of a candidate solution using a stochastically greedy construction process. The function works by building a Restricted Candidate List (RCL) that constraints the components of a solution (features) that may be selected from each cycle. The RCL may be constrained by an explicit size, or by using a threshold ($["\\alpha \\in [0,1]"]$) on the cost of adding each feature to the current candidate solution. +Algorithm (below) provides the pseudocode the Greedy Randomized Construction function. The function involves the step-wise construction of a candidate solution using a stochastically greedy construction process. The function works by building a Restricted Candidate List (RCL) that constraints the components of a solution (features) that may be selected from each cycle. The RCL may be constrained by an explicit size, or by using a threshold ($\alpha \in [0,1]$) on the cost of adding each feature to the current candidate solution.
Input
: @@ -106,8 +106,8 @@Procedure
Heuristics
-
@@ -224,8 +224,8 @@- The $["\\alpha"]$ threshold defines the amount of greediness of the construction mechanism, where values close to 0 may be too greedy, and values close to 1 may be too generalized.
-- As an alternative to using the $["\\alpha"]$ threshold, the RCL can be constrained to the top $["n\\%"]$ of candidate features that may be selected from each construction cycle.
+- The $\alpha$ threshold defines the amount of greediness of the construction mechanism, where values close to 0 may be too greedy, and values close to 1 may be too generalized.
+- As an alternative to using the $\alpha$ threshold, the RCL can be constrained to the top $n%$ of candidate features that may be selected from each construction cycle.
- The technique was designed for discrete problem classes such as combinatorial optimization problems.
Primary Sources
Learn More
There are a vast number of review, application, and extension papers for GRASP. -Pitsoulis and Resende provide an extensive contemporary overview of the field as a review chapter [Pitsoulis2002], as does Resende and Ribeiro that includes a clear presentation of the use of the $["\\alpha"]$ threshold parameter instead of a fixed size for the RCL [Resende2003]. Festa and Resende provide an annotated bibliography as a review chapter that provides some needed insight into large amount of study that has gone into the approach [Festa2002]. -There are numerous extensions to GRASP, not limited to the popular Reactive GRASP for adapting $["\\alpha"]$ [Prais2000], the use of long term memory to allow the technique to learn from candidate solutions discovered in previous iterations, and parallel implementations of the procedure such as 'Parallel GRASP' [Pardalos1995]. +Pitsoulis and Resende provide an extensive contemporary overview of the field as a review chapter [Pitsoulis2002], as does Resende and Ribeiro that includes a clear presentation of the use of the $\alpha$ threshold parameter instead of a fixed size for the RCL [Resende2003]. Festa and Resende provide an annotated bibliography as a review chapter that provides some needed insight into large amount of study that has gone into the approach [Festa2002]. +There are numerous extensions to GRASP, not limited to the popular Reactive GRASP for adapting $\alpha$ [Prais2000], the use of long term memory to allow the technique to learn from candidate solutions discovered in previous iterations, and parallel implementations of the procedure such as 'Parallel GRASP' [Pardalos1995].
diff --git a/docs/nature-inspired/stochastic/guided_local_search.html b/docs/nature-inspired/stochastic/guided_local_search.html index 0db0dbd9..a89537bb 100644 --- a/docs/nature-inspired/stochastic/guided_local_search.html +++ b/docs/nature-inspired/stochastic/guided_local_search.html @@ -52,12 +52,12 @@Strategy
Procedure
Algorithm (below) provides a pseudocode listing of the Guided Local Search algorithm for minimization. -The Local Search algorithm used by the Guided Local Search algorithm uses an augmented cost function in the form $["h(s)=g(s)+\\lambda\\cdot\\sum_{i=1}^{M}f_i"]$, where -$["h(s)"]$ is the augmented cost function, $["g(s)"]$ is the problem cost function,$["\\lambda"]$ is the 'regularization parameter' (a coefficient for scaling the penalties), $["s"]$ is a locally optimal solution of $["M"]$ features, and $["f_i"]$ is the $["i"]$'th feature in locally optimal solution. The augmented cost function is only used by the local search procedure, the Guided Local Search algorithm uses the problem specific cost function without augmentation. +The Local Search algorithm used by the Guided Local Search algorithm uses an augmented cost function in the form $h(s)=g(s)+\lambda\cdot\sum_{i=1}^{M}f_i$, where +$h(s)$ is the augmented cost function, $g(s)$ is the problem cost function,$\lambda$ is the 'regularization parameter' (a coefficient for scaling the penalties), $s$ is a locally optimal solution of $M$ features, and $f_i$ is the $i$'th feature in locally optimal solution. The augmented cost function is only used by the local search procedure, the Guided Local Search algorithm uses the problem specific cost function without augmentation.
Penalties are only updated for those features in a locally optimal solution that maximize utility, updated by adding 1 to the penalty for the future (a counter). -The utility for a feature is calculated as $["U_{feature}=\\frac{C_{feature}}{1+P_{feature}}"]$, where $["U_{feature}"]$ is the utility for penalizing a feature (maximizing), $["C_{feature}"]$ is the cost of the feature, and $["P_{feature}"]$ is the current penalty for the feature. +The utility for a feature is calculated as $U_{feature}=\frac{C_{feature}}{1+P_{feature}}$, where $U_{feature}$ is the utility for penalizing a feature (maximizing), $C_{feature}$ is the cost of the feature, and $P_{feature}$ is the current penalty for the feature.
Input
: @@ -87,7 +87,7 @@Heuristics
- The Guided Local Search procedure is independent of the Local Search procedure embedded within it. A suitable domain-specific search procedure should be identified and employed.
- The Guided Local Search procedure may need to be executed for thousands to hundreds-of-thousands of iterations, each iteration of which assumes a run of a Local Search algorithm to convergence.
- The algorithm was designed for discrete optimization problems where a solution is comprised of independently assessable 'features' such as Combinatorial Optimization, although it has been applied to continuous function optimization modeled as binary strings.
-- The $["\\lambda"]$ parameter is a scaling factor for feature penalization that must be in the same proportion to the candidate solution costs from the specific problem instance to which the algorithm is being applied. As such, the value for $["\\lambda"]$ must be meaningful when used within the augmented cost function (such as when it is added to a candidate solution cost in minimization and subtracted from a cost in the case of a maximization problem).
+- The $\lambda$ parameter is a scaling factor for feature penalization that must be in the same proportion to the candidate solution costs from the specific problem instance to which the algorithm is being applied. As such, the value for $\lambda$ must be meaningful when used within the augmented cost function (such as when it is added to a candidate solution cost in minimization and subtracted from a cost in the case of a maximization problem).
@@ -101,8 +101,8 @@Code Listing
A TSP-specific local search algorithm is used called 2-opt that selects two points in a permutation and reconnects the tour, potentially untwisting the tour at the selected points. The stopping condition for 2-opt was configured to be a fixed number of non-improving moves.-The equation for setting $["\\lambda"]$ for TSP instances is $["\\lambda = \\alpha\\cdot\\frac{cost(optima)}{N}"]$, where $["N"]$ is the number of cities, $["cost(optima)"]$ is the cost of a local optimum found by a local search, and $["\\alpha\\in (0,1]"]$ (around 0.3 for TSP and 2-opt). The cost of a local optima was fixed to the approximated value of 15000 for the Berlin52 instance. -The utility function for features (edges) in the TSP is $["U_{edge}=\\frac{D_{edge}}{1+P_{edge}}"]$, where $["U_{edge}"]$ is the utility for penalizing an edge (maximizing), $["D_{edge}"]$ is the cost of the edge (distance between cities) and $["P_{edge}"]$ is the current penalty for the edge. +The equation for setting $\lambda$ for TSP instances is $\lambda = \alpha\cdot\frac{cost(optima)}{N}$, where $N$ is the number of cities, $cost(optima)$ is the cost of a local optimum found by a local search, and $\alpha\in (0,1]$ (around 0.3 for TSP and 2-opt). The cost of a local optima was fixed to the approximated value of 15000 for the Berlin52 instance. +The utility function for features (edges) in the TSP is $U_{edge}=\frac{D_{edge}}{1+P_{edge}}$, where $U_{edge}$ is the utility for penalizing an edge (maximizing), $D_{edge}$ is the cost of the edge (distance between cities) and $P_{edge}$ is the current penalty for the edge.
def euc_2d(c1, c2) diff --git a/docs/nature-inspired/stochastic/random_search.html b/docs/nature-inspired/stochastic/random_search.html index bf25910e..b0da8ef1 100644 --- a/docs/nature-inspired/stochastic/random_search.html +++ b/docs/nature-inspired/stochastic/random_search.html @@ -87,7 +87,7 @@Code Listing
Listing (below) provides an example of the Random Search Algorithm implemented in the Ruby Programming Language. In the example, the algorithm runs for a fixed number of iterations and returns the best candidate solution discovered. -The example problem is an instance of a continuous function optimization that seeks $["\\min f(x)"]$ where $["f=\\sum_{i=1}^n x_{i}^2"]$, $["-5.0\\leq x_i \\leq 5.0"]$ and $["n=2"]$. The optimal solution for this basin function is $["(v_0,\\ldots,v_{n-1})=0.0"]$. +The example problem is an instance of a continuous function optimization that seeks $\min f(x)$ where $f=\sum_{i=1}^n x_{i}^2$, $-5.0\leq x_i \leq 5.0$ and $n=2$. The optimal solution for this basin function is $(v_0,\ldots,v_{n-1})=0.0$.
def objective_function(vector) diff --git a/docs/nature-inspired/stochastic/scatter_search.html b/docs/nature-inspired/stochastic/scatter_search.html index b8326dbc..3efeb1e8 100644 --- a/docs/nature-inspired/stochastic/scatter_search.html +++ b/docs/nature-inspired/stochastic/scatter_search.html @@ -99,7 +99,7 @@Heuristics
Code Listing
Listing (below) provides an example of the Scatter Search algorithm implemented in the Ruby Programming Language. -The example problem is an instance of a continuous function optimization that seeks $["\\min f(x)"]$ where $["f=\\sum_{i=1}^n x_{i}^2"]$, $["-5.0\\leq x_i \\leq 5.0"]$ and $["n=3"]$. The optimal solution for this basin function is $["(v_1,\\ldots,v_{n})=0.0"]$. +The example problem is an instance of a continuous function optimization that seeks $\min f(x)$ where $f=\sum_{i=1}^n x_{i}^2$, $-5.0\leq x_i \leq 5.0$ and $n=3$. The optimal solution for this basin function is $(v_1,\ldots,v_{n})=0.0$.
The algorithm is an implementation of Scatter Search as described in an application of the technique to unconstrained non-linear optimization by Glover [Glover2003b]. The seeds for initial solutions are generated as random vectors, as opposed to stratified samples. The example was further simplified by not including a restart strategy, and the exclusion of diversity maintenance in the
ReferenceSet
. A stochastic local search algorithm is used as the embedded heuristic that uses a stochastic step size in the range of half a percent of the search space. diff --git a/docs/nature-inspired/swarm/ant_colony_system.html b/docs/nature-inspired/swarm/ant_colony_system.html index 959c80a6..dcdfe26a 100644 --- a/docs/nature-inspired/swarm/ant_colony_system.html +++ b/docs/nature-inspired/swarm/ant_colony_system.html @@ -64,25 +64,25 @@Strategy
Procedure
Algorithm (below) provides a pseudocode listing of the main Ant Colony System algorithm for minimizing a cost function. -The probabilistic step-wise construction of solution makes use of both history (pheromone) and problem-specific heuristic information to incrementally construct a solution piece-by-piece. Each component can only be selected if it has not already been chosen (for most combinatorial problems), and for those components that can be selected from given the current component $["i"]$, their probability for selection is defined as: +The probabilistic step-wise construction of solution makes use of both history (pheromone) and problem-specific heuristic information to incrementally construct a solution piece-by-piece. Each component can only be selected if it has not already been chosen (for most combinatorial problems), and for those components that can be selected from given the current component $i$, their probability for selection is defined as:
$P_{i,j} \leftarrow \frac{\tau_{i,j}^{\alpha} \times \eta_{i,j}^{\beta}}{\sum_{k=1}^c \tau_{i,k}^{\alpha} \times \eta_{i,k}^{\beta}}$-where $["\\eta_{i,j}"]$ is the maximizing contribution to the overall score of selecting the component (such as $["\\frac{1.0}{distance_{i,j}}"]$ for the Traveling Salesman Problem), $["\\beta"]$ is the heuristic coefficient (commonly fixed at 1.0), $["\\tau_{i,j}"]$ is the pheromone value for the component, $["\\alpha"]$ is the history coefficient, and $["c"]$ is the set of usable components. A greediness factor ($["q0"]$) is used to influence when to use the above probabilistic component selection and when to greedily select the best possible component. +where $\eta_{i,j}$ is the maximizing contribution to the overall score of selecting the component (such as $\frac{1.0}{distance_{i,j}}$ for the Traveling Salesman Problem), $\beta$ is the heuristic coefficient (commonly fixed at 1.0), $\tau_{i,j}$ is the pheromone value for the component, $\alpha$ is the history coefficient, and $c$ is the set of usable components. A greediness factor ($q0$) is used to influence when to use the above probabilistic component selection and when to greedily select the best possible component.
A local pheromone update is performed for each solution that is constructed to dissuade following solutions to use the same components in the same order, as follows:
$\tau_{i,j} \leftarrow (1-\sigma) \times \tau_{i,j} + \sigma \times \tau_{i,j}^{0}$-where $["\\tau_{i,j}"]$ represents the pheromone for the component (graph edge) ($["i,j"]$), $["\\sigma"]$ is the local pheromone factor, and $["\\tau_{i,j}^{0}"]$ is the initial pheromone value. +where $\tau_{i,j}$ represents the pheromone for the component (graph edge) ($i,j$), $\sigma$ is the local pheromone factor, and $\tau_{i,j}^{0}$ is the initial pheromone value.
At the end of each iteration, the pheromone is updated and decayed using the best candidate solution found thus far (or the best candidate solution found for the iteration), as follows:
$\tau_{i,j} \leftarrow (1-\rho) \times \tau_{i,j} + \rho \times \Delta\tau{i,j}$-where $["\\tau_{i,j}"]$ represents the pheromone for the component (graph edge) ($["i,j"]$), $["\\rho"]$ is the decay factor, and $["\\Delta\\tau{i,j}"]$ is the maximizing solution cost for the best solution found so far if the component $["ij"]$ is used in the globally best known solution, otherwise it is 0. +where $\tau_{i,j}$ represents the pheromone for the component (graph edge) ($i,j$), $\rho$ is the decay factor, and $\Delta\tau{i,j}$ is the maximizing solution cost for the best solution found so far if the component $ij$ is used in the globally best known solution, otherwise it is 0.
Input
: @@ -116,11 +116,11 @@Procedure
Heuristics
diff --git a/docs/nature-inspired/swarm/ant_system.html b/docs/nature-inspired/swarm/ant_system.html index a6497267..8157dda8 100644 --- a/docs/nature-inspired/swarm/ant_system.html +++ b/docs/nature-inspired/swarm/ant_system.html @@ -68,14 +68,14 @@
- The Ant Colony System algorithm was designed for use with combinatorial problems such as the TSP, knapsack problem, quadratic assignment problems, graph coloring problems and many others.
-- The local pheromone (history) coefficient ($["\\sigma"]$) controls the amount of contribution history plays in a components probability of selection and is commonly set to 0.1.
-- The heuristic coefficient ($["\\beta"]$) controls the amount of contribution problem-specific heuristic information plays in a components probability of selection and is commonly between 2 and 5, such as 2.5.
-- The decay factor ($["\\rho"]$) controls the rate at which historic information is lost and is commonly set to 0.1.
-- The greediness factor ($["q0"]$) is commonly set to 0.9.
-- The total number of ants ($["m"]$) is commonly set low, such as 10.
+- The local pheromone (history) coefficient ($\sigma$) controls the amount of contribution history plays in a components probability of selection and is commonly set to 0.1.
+- The heuristic coefficient ($\beta$) controls the amount of contribution problem-specific heuristic information plays in a components probability of selection and is commonly between 2 and 5, such as 2.5.
+- The decay factor ($\rho$) controls the rate at which historic information is lost and is commonly set to 0.1.
+- The greediness factor ($q0$) is commonly set to 0.9.
+- The total number of ants ($m$) is commonly set low, such as 10.
Procedure
$\tau_{i,j} \leftarrow (1-\rho) \times \tau_{i,j} + \sum_{k=1}^m \Delta_{i,j}^k$-where $["\\tau_{i,j}"]$ represents the pheromone for the component (graph edge) ($["i,j"]$), $["\\rho"]$ is the decay factor, $["m"]$ is the number of ants, and $["\\sum_{k=1}^m \\Delta_{i,j}^k "]$ is the sum of $["\\frac{1}{S_{cost}} "]$ (maximizing solution cost) for those solutions that include component $["i,j"]$. The Pseudocode listing shows this equation as an equivalent as a two step process of decay followed by update for simplicity. +where $\tau_{i,j}$ represents the pheromone for the component (graph edge) ($i,j$), $\rho$ is the decay factor, $m$ is the number of ants, and $\sum_{k=1}^m \Delta_{i,j}^k $ is the sum of $\frac{1}{S_{cost}} $ (maximizing solution cost) for those solutions that include component $i,j$. The Pseudocode listing shows this equation as an equivalent as a two step process of decay followed by update for simplicity.
-The probabilistic step-wise construction of solution makes use of both history (pheromone) and problem-specific heuristic information to incrementally construction a solution piece-by-piece. Each component can only be selected if it has not already been chosen (for most combinatorial problems), and for those components that can be selected from (given the current component $["i"]$), their probability for selection is defined as: +The probabilistic step-wise construction of solution makes use of both history (pheromone) and problem-specific heuristic information to incrementally construction a solution piece-by-piece. Each component can only be selected if it has not already been chosen (for most combinatorial problems), and for those components that can be selected from (given the current component $i$), their probability for selection is defined as:
$P_{i,j} \leftarrow \frac{\tau_{i,j}^{\alpha} \times \eta_{i,j}^{\beta}}{\sum_{k=1}^c \tau_{i,k}^{\alpha} \times \eta_{i,k}^{\beta}}$-where $["\\eta_{i,j}"]$ is the maximizing contribution to the overall score of selecting the component (such as $["\\frac{1.0}{distance_{i,j}}"]$ for the Traveling Salesman Problem), $["\\alpha"]$ is the heuristic coefficient, $["\\tau_{i,j}"]$ is the pheromone value for the component, $["\\beta"]$ is the history coefficient, and $["c"]$ is the set of usable components. +where $\eta_{i,j}$ is the maximizing contribution to the overall score of selecting the component (such as $\frac{1.0}{distance_{i,j}}$ for the Traveling Salesman Problem), $\alpha$ is the heuristic coefficient, $\tau_{i,j}$ is the pheromone value for the component, $\beta$ is the history coefficient, and $c$ is the set of usable components.
Input
: @@ -112,10 +112,10 @@Procedure
Heuristics
diff --git a/docs/nature-inspired/swarm/bees_algorithm.html b/docs/nature-inspired/swarm/bees_algorithm.html index f3ef6294..5a5d9734 100644 --- a/docs/nature-inspired/swarm/bees_algorithm.html +++ b/docs/nature-inspired/swarm/bees_algorithm.html @@ -109,16 +109,16 @@
- The Ant Systems algorithm was designed for use with combinatorial problems such as the TSP, knapsack problem, quadratic assignment problems, graph coloring problems and many others.
-- The history coefficient ($["\\alpha"]$) controls the amount of contribution history plays in a components probability of selection and is commonly set to 1.0.
-- The heuristic coefficient ($["\\beta"]$) controls the amount of contribution problem-specific heuristic information plays in a components probability of selection and is commonly between 2 and 5, such as 2.5.
-- The decay factor ($["\\rho"]$) controls the rate at which historic information is lost and is commonly set to 0.5.
-- The total number of ants ($["m"]$) is commonly set to the number of components in the problem, such as the number of cities in the TSP.
+- The history coefficient ($\alpha$) controls the amount of contribution history plays in a components probability of selection and is commonly set to 1.0.
+- The heuristic coefficient ($\beta$) controls the amount of contribution problem-specific heuristic information plays in a components probability of selection and is commonly between 2 and 5, such as 2.5.
+- The decay factor ($\rho$) controls the rate at which historic information is lost and is commonly set to 0.5.
+- The total number of ants ($m$) is commonly set to the number of components in the problem, such as the number of cities in the TSP.
Procedure
Heuristics
- The Bees Algorithm was developed to be used with continuous and combinatorial function optimization problems.
-- The $["Patch_{size}"]$ variable is used as the neighborhood size. For example, in a continuous function optimization problem, each dimension of a site would be sampled as $["x_i \\pm (rand() \\times Patch_{size})"]$.
-- The $["Patch_{size}"]$ variable is decreased each iteration, typically by a constant amount (such as 0.95).
-- The number of elite sites ($["EliteSites_{num}"]$) must be $["<"]$ the number of sites ($["Sites_{num}"]$), and the number of elite bees ($["EliteBees_{num}"]$) is traditionally $["<"]$ the number of other bees ($["OtherBees_{num}"]$).
+- The $Patch_{size}$ variable is used as the neighborhood size. For example, in a continuous function optimization problem, each dimension of a site would be sampled as $x_i \pm (rand \times Patch_{size})$.
+- The $Patch_{size}$ variable is decreased each iteration, typically by a constant amount (such as 0.95).
+- The number of elite sites ($EliteSites_{num}$) must be $<$ the number of sites ($Sites_{num}$), and the number of elite bees ($EliteBees_{num}$) is traditionally $<$ the number of other bees ($OtherBees_{num}$).
Code Listing
Listing (below) provides an example of the Bees Algorithm implemented in the Ruby Programming Language. -The demonstration problem is an instance of a continuous function optimization that seeks $["\\min f(x)"]$ where $["f=\\sum_{i=1}^n x_{i}^2"]$, $["-5.0\\leq x_i \\leq 5.0"]$ and $["n=3"]$. The optimal solution for this basin function is $["(v_0,\\ldots,v_{n-1})=0.0"]$. +The demonstration problem is an instance of a continuous function optimization that seeks $\min f(x)$ where $f=\sum_{i=1}^n x_{i}^2$, $-5.0\leq x_i \leq 5.0$ and $n=3$. The optimal solution for this basin function is $(v_0,\ldots,v_{n-1})=0.0$. The algorithm is an implementation of the Bees Algorithm as described in the seminal paper [Pham2006]. A fixed patch size decrease factor of 0.95 was applied each iteration.
diff --git a/docs/nature-inspired/swarm/bfoa.html b/docs/nature-inspired/swarm/bfoa.html index d2ce70d2..dbe1eaf2 100644 --- a/docs/nature-inspired/swarm/bfoa.html +++ b/docs/nature-inspired/swarm/bfoa.html @@ -66,14 +66,14 @@Strategy
Procedure
Algorithm (below) provides a pseudocode listing of the Bacterial Foraging Optimization Algorithm for minimizing a cost function. Algorithm (below) provides the pseudocode listing for the chemotaxis and swing behaviour of the BFOA algorithm. -A bacteria cost is derated by its interaction with other cells. This interaction function ($["g()"]$) is calculated as follows: +A bacteria cost is derated by its interaction with other cells. This interaction function ($g$) is calculated as follows:
$g(cell_k) = \sum_{i=1}^S\bigg[-d_{attr}\times exp\bigg(-w_{attr}\times \sum_{m=1}^P (cell_m^k - other_m^i)^2 \bigg) \bigg] + \sum_{i=1}^S\bigg[h_{repel}\times exp\bigg(-w_{repel}\times \sum_{m=1}^P cell_m^k - other_m^i)^2 \bigg) \bigg]$-where $["cell_k"]$ is a given cell, $["d_{attr}"]$ and $["w_{attr}"]$ are attraction coefficients, $["h_{repel}"]$ and $["w_{repel}"]$ are repulsion coefficients, $["S"]$ is the number of cells in the population, $["P"]$ is the number of dimensions on a given cells position vector. +where $cell_k$ is a given cell, $d_{attr}$ and $w_{attr}$ are attraction coefficients, $h_{repel}$ and $w_{repel}$ are repulsion coefficients, $S$ is the number of cells in the population, $P$ is the number of dimensions on a given cells position vector.
-The remaining parameters of the algorithm are as follows $["Cells_{num}"]$ is the number of cells maintained in the population, $["N_{ed}"]$ is the number of elimination-dispersal steps, $["N_{re}"]$ is the number of reproduction steps, $["N_{c}"]$ is the number of chemotaxis steps, $["N_{s}"]$ is the number of swim steps for a given cell, $["Step_{size}"]$ is a random direction vector with the same number of dimensions as the problem space, and each value $["\\in [-1,1]"]$, and $["P_{ed}"]$ is the probability of a cell being subjected to elimination and dispersal. +The remaining parameters of the algorithm are as follows $Cells_{num}$ is the number of cells maintained in the population, $N_{ed}$ is the number of elimination-dispersal steps, $N_{re}$ is the number of reproduction steps, $N_{c}$ is the number of chemotaxis steps, $N_{s}$ is the number of swim steps for a given cell, $Step_{size}$ is a random direction vector with the same number of dimensions as the problem space, and each value $\in [-1,1]$, and $P_{ed}$ is the probability of a cell being subjected to elimination and dispersal.
Input
: @@ -137,17 +137,17 @@Heuristics
- The algorithm was designed for application to continuous function optimization problem domains.
- Given the loops in the algorithm, it can be configured numerous ways to elicit different search behavior. It is common to have a large number of chemotaxis iterations, and small numbers of the other iterations.
-- The default coefficients for swarming behavior (cell-cell interactions) are as follows $["d_{attract}=0.1"]$, $["w_{attract}=0.2"]$, $["h_{repellant}=d_{attract}"]$, and $["w_{repellant}=10"]$.
+- The default coefficients for swarming behavior (cell-cell interactions) are as follows $d_{attract}=0.1$, $w_{attract}=0.2$, $h_{repellant}=d_{attract}$, and $w_{repellant}=10$.
- The step size is commonly a small fraction of the search space, such as 0.1.
- During reproduction, typically half the population with a low health metric are discarded, and two copies of each member from the first (high-health) half of the population are retained.
-- The probability of elimination and dispersal ($["p_{ed}"]$) is commonly set quite large, such as 0.25.
+- The probability of elimination and dispersal ($p_{ed}$) is commonly set quite large, such as 0.25.
Code Listing
Listing (below) provides an example of the Bacterial Foraging Optimization Algorithm implemented in the Ruby Programming Language. -The demonstration problem is an instance of a continuous function optimization that seeks $["\\min f(x)"]$ where $["f=\\sum_{i=1}^n x_{i}^2"]$, $["-5.0\\leq x_i \\leq 5.0"]$ and $["n=2"]$. The optimal solution for this basin function is $["(v_0,\\ldots,v_{n-1})=0.0"]$. +The demonstration problem is an instance of a continuous function optimization that seeks $\min f(x)$ where $f=\sum_{i=1}^n x_{i}^2$, $-5.0\leq x_i \leq 5.0$ and $n=2$. The optimal solution for this basin function is $(v_0,\ldots,v_{n-1})=0.0$. The algorithm is an implementation based on the description on the seminal work [Passino2002]. The parameters for cell-cell interactions (attraction and repulsion) were taken from the paper, and the various loop parameters were taken from the 'Swarming Effects' example.
diff --git a/docs/nature-inspired/swarm/pso.html b/docs/nature-inspired/swarm/pso.html index 1606d596..14adad52 100644 --- a/docs/nature-inspired/swarm/pso.html +++ b/docs/nature-inspired/swarm/pso.html @@ -67,7 +67,7 @@Procedure
$v_{i}(t+1) = v_{i}(t) + \big( c_1 \times rand() \times (p_{i}^{best} - p_{i}(t)) \big) + \big( c_2 \times rand() \times (p_{gbest} - p_{i}(t)) \big)$-where $["v_{i}(t+1)"]$ is the new velocity for the $["i^{th}"]$ particle, $["c_1"]$ and $["c_2"]$ are the weighting coefficients for the personal best and global best positions respectively, $["p_{i}(t)"]$ is the $["i^{th}"]$ particle's position at time $["t"]$, $["p_{i}^{best}"]$ is the $["i^{th}"]$ particle's best known position, and $["p_{gbest}"]$ is the best position known to the swarm. The $["rand()"]$ function generate a uniformly random variable $["\\in [0,1]"]$. Variants on this update equation consider best positions within a particles local neighborhood at time $["t"]$. +where $v_{i}(t+1)$ is the new velocity for the $i^{th}$ particle, $c_1$ and $c_2$ are the weighting coefficients for the personal best and global best positions respectively, $p_{i}(t)$ is the $i^{th}$ particle's position at time $t$, $p_{i}^{best}$ is the $i^{th}$ particle's best known position, and $p_{gbest}$ is the best position known to the swarm. The $rand$ function generate a uniformly random variable $\in [0,1]$. Variants on this update equation consider best positions within a particles local neighborhood at time $t$.
A particle's position is updated using: @@ -125,7 +125,7 @@
Heuristics
Code Listing
Listing (below) provides an example of the Particle Swarm Optimization algorithm implemented in the Ruby Programming Language. -The demonstration problem is an instance of a continuous function optimization that seeks $["\\min f(x)"]$ where $["f=\\sum_{i=1}^n x_{i}^2"]$, $["-5.0\\leq x_i \\leq 5.0"]$ and $["n=3"]$. The optimal solution for this basin function is $["(v_0,\\ldots,v_{n-1})=0.0"]$. +The demonstration problem is an instance of a continuous function optimization that seeks $\min f(x)$ where $f=\sum_{i=1}^n x_{i}^2$, $-5.0\leq x_i \leq 5.0$ and $n=3$. The optimal solution for this basin function is $(v_0,\ldots,v_{n-1})=0.0$. The algorithm is a conservative version of Particle Swarm Optimization based on the seminal papers. The implementation limits the velocity at a pre-defined maximum, and bounds particles to the search space, reflecting their movement and velocity if the bounds of the space are exceeded. Particles are influenced by the best position found as well as their own personal best position. Natural extensions may consider limiting velocity with an inertia coefficient and including a neighborhood function for the particles.
diff --git a/web/generate.rb b/web/generate.rb index 7a2b25de..7b5f61ef 100644 --- a/web/generate.rb +++ b/web/generate.rb @@ -325,9 +325,9 @@ def character_processing(s) # sucks i know def post_process_text(s) # extract math - math, arrays = [], [] - s.scan(/\$([^$]+)\$/) {|m| math << m } # $$ - s.scan(/\\\[([^$]+)\\\]/) {|m| arrays << m } # \[ \] + # math, arrays = [], [] + # s.scan(/\$([^$]+)\$/) {|m| math << m } # $$ + # s.scan(/\\\[([^$]+)\\\]/) {|m| arrays << m } # \[ \] # citations s = replace_citations(s) # listings, algorithms, tables @@ -392,21 +392,23 @@ def post_process_text(s) # finally switch ` for ' (late in the subs) s = s.gsub("`", "'") - # put the math back - if !math.empty? - index = 0 - s = s.gsub(/\$([^$]+)\$/) do |m| - index += 1 - "$#{math[index - 1]}$" - end - end - if !arrays.empty? - index = 0 - s = s.gsub(/\\\[([^$]+)\\\]/) do |m| - index += 1 - "\\[#{arrays[index - 1]}\\]" - end - end + + # # put the math back + # if !math.empty? + # index = 0 + # s = s.gsub(/\$([^$]+)\$/) do |m| + # index += 1 + # "$#{math[index - 1]}$" + # end + # end + # puts(s) + # if !arrays.empty? + # index = 0 + # s = s.gsub(/\\\[([^$]+)\\\]/) do |m| + # index += 1 + # "\\[#{arrays[index - 1]}\\]" + # end + # end return s end @@ -1552,7 +1554,7 @@ def create_sitemap add_line(s, "") add_line(s, "") # html - host = "http://www.cleveralgorithms.com" + host = "http://cleveralgorithms.com" dir = "nature-inspired" # all pages Dir.entries(OUTPUT_DIR).each do |file|