Original text: The use of fuzzy set and Membership function--aforge.net Framework (i)
What is Aforge.net?
Aforge.net is a framework developed for developers and researchers that can be used in computer vision, genetic algorithms, image processing, neural networks, robot learning and control, machine learning and fuzzy systems.
Aforge.net's official documents are rich, there are some related articles on the internet, but more about the vision and neural network, and I am personally interested in the fuzzy system, so write down some of their feelings.
Brief introduction of fuzzy system and fuzzy theory
Fuzzy systems are mainly distinguished from classical systems (or conventional systems). In the study of human-machine systems, management systems, especially economic and social systems, because of the logic, reasoning, judgment of the people involved, many decisions are difficult to achieve completely accurate, these and human-related systems have some kind of ambiguity.
In a conventional system, if the state and input of a system at a moment are determined, the state and output of the next moment can be determined. If the next state is not determined, but the probability distribution can be given, it becomes stochastic system. If the probability distribution is not given, but the set of all possible states can be given, and the set of all possible states is represented by a fuzzy set, it becomes the fuzzy system.
Vague phenomena exist in the objective world, such as "young people" and "old people" are vague concepts, they have no explicit connotation and extension, but they seldom produce misunderstanding and ambiguity when using these concepts. It can be said that the value logic is just the model of the ideal world, not the real world model.
Membership functions (Membership function) and fuzzy sets (sets)
Membership function is the mathematical foundation of fuzzy system, it breaks through the limitation of classical set theory, and the quantitative representation of fuzzy concept becomes possible.
The brown curve is a membership function, 0 is not, and 1 is completely. Because of fuzziness, the numbers on [0,1] are substituted for 0 and 1.
And this value is the degree to which the fuzzy set belongs.
A fuzzy set can be divided into two parts, one of which becomes the core, which is a relaxed set of 1 of each x's membership.
There is also a part of boundary, which contains all the elements that are subordinate to 0, 1.
The choice of membership function is mainly determined by fuzzy set. If a set contains a large number of values or it is contiguous, then a parameterized representation of the membership function is appropriate, the general Piecewise linear membership function (piecewise linear membership functions) is relatively good, it is simple and computationally efficient. The more commonly used is a trapezoid or a triangle, defined by 4 or 3 parameters.
Take the temperature as an example, in the actual life we often say how many degrees, cold not cold. The number of degrees can be a definite value or range, but cold can not be fixed, it is difficult to find a fixed burst value. Generally can be generally cold, warm, hot.
The membership function can be thought of as a (x) = warm.
It's hot.
Aforge.net representation of fuzzy sets and membership functions
Need to use to Aforge,aforge.fuzzy and Aforge.controls.
Aforge is the core class, aforge.fuzzy about the fuzzy system, and Aforge.controls is some of the controls that are more commonly used as table (chart) controls.
You can go to http://code.google.com/p/aforge/to download and then reference the required. I use the nuget directly.
Aforge.fuzzy in NuGet no ha.
The Piecewiselinearfunction class is undoubtedly the most flexible, but if the membership function is trapezoidal or triangular, there is a quicker class to use: Trapezoidalfunction.
For example, we want to create a trapezoidal membership function, if:
There are 4 points to note, (10,0) and (40,0), which are the boundaries of boundary. (20,0) and (30,0) are the boundaries of the core.
New Trapezoidalfunction (ten);
New Fuzzyset ("COLD", Functioncool);
Get the degree of membership by Fuzzyset.getmembership (i). Then give the chart control a two-dimensional array to draw.
Double New Double [2
for (int0
0
1
}
Chart. Updatedataseries ("COLD", coolvalues);
Effect:
Of course, the missing half-boundary function is also common.
The key points are (30,0) and (40,0).
Trapezoidalfunction Functioncool =NewTrapezoidalfunction ( -, +, TrapezoidalFunction.EdgeType.Right);
Fuzzyset Fscool =NewFuzzyset ("WARM", Functioncool);
Double[,] coolvalues =New Double[ -,2];
for(inti =0; I < -; i++)
{
Coolvalues[i,0] = i;
Coolvalues[i,1] = Fscool.getmembership (i);
}
Chart. Updatedataseries ("WARM", coolvalues);
Effect:
function of the triangle:
New Trapezoidalfunction (+,+);
Of course piecewiselinearfunction can have a richer performance, just make the key points in it can form a lot of functions.
Aforge.point[] points =Newaforge.point[6];
points[0] =NewAforge.point (Ten,0);
points[1] =NewAforge.point ( A,0.8f);
points[2] =NewAforge.point ( -,0.9f);
points[3] =NewAforge.point ( -,1);
points[4] =NewAforge.point ( +,0.1f);
points[5] =NewAforge.point ( -,0);
Piecewiselinearfunction membershipfunction =NewPiecewiselinearfunction (points);
Fuzzyset Fscool =NewFuzzyset (" Hot", membershipfunction);
Double[,] coolvalues =New Double[ -,2];
for(inti =0; I < -; i++)
{
Coolvalues[i,0] = i;
Coolvalues[i,1] = Fscool.getmembership (i);
}
Chart. Updatedataseries (" Hot", coolvalues);
:
There is also a special membership function: Singletonfunction. It is used only for classic values.
New Singletonfunction (a);
Related downloads: http://www.ctdisk.com/file/4466992
The use of fuzzy set and Membership function--aforge.net Framework (i.)