tags: classical ai

A variable in fuzzy logic can have a value between 0 and 1 an it measures the value of truthfulness, unlike boolean logic variables can only have a value of 0 or 1. Boolean logic focuses on drawing lines between classes. The truthfulness value can also be called degree of membership since it measure how much an object belong to fuzzy set..

Fuzzy logic can deal with real world vagueness. From my current understanding crisp values are values from the real world.

Membership function

The membership function is a function that gives the truthfulness value of a variable. For example, the truthfulness value of somebody is 45 years old is given by the function defined by the following graph. A numerical example: is defined by the y axis value for the very_young set.

The boolean counterpart for this is called a characteristic function and it defines a crisp set.

Linguistic variables and values

Linguistic variables are fuzzy variables that I conclude from language statements. For example the sentence “speed is slow”, speed here is linguistic variable and it is given the linguistic value slow. The universe of discourse are the possible values the linguistic variable represents, or we can say the X axis that we say in the image above, and for speed it can range from 0 to 220 km/h for example. The linguistic values are represented by subsets, like the slow set can have values from 30 to 60 km/h.

Hedges

They are adverbs that modify the value of the fuzzy set, adverbs like “very”, “extremely”, etc.. We can see that the value of the fuzzy sets is modified when we want the value of a variable being for example “very tall”.

Logic operations

The operations are the same as boolean logic, but they are done differently. With crisp sets we take the intersection of elements themselves.

There is also a containment operations, it has the symbol . We can say tall men all men, this means the all men set contains tall men.

In reality we don’t really care much about the function that performs the AND operation, it literally could be anything, the most important thing is that it satisfies the cases shown in the following table., any numbers in between we don’t really care about much.

Some formal definitions

My current interpretation is that X is the set of objects that I’ll measure their truthfulness value.

Fuzzy Controller

Fuzzification interface: transforms real values or crisp values to fuzzy values. Decision-making unit: evaluates the rules. Rule Base: stores all the rules that are used for evaluation and have relations between the inputs and the outputs.

The advantage of using the fuzzy controller instead of the normal controller, is that the normal controller maps the input to the output using mathematical relations, this doesn’t give the best result, instead the fuzzy controller uses state representation and logic to get realistic values.

Inference

When using the fuzzy controller we would want to transform the fuzzy output variable to real value, we do that by looking at the fuzzy rules we have in the system. Let’s say we have the rules above, we will use the Mamdany inference style to get the output.

Mamdany Inference

The first step of the Mamdany inference is rule evaluation.

Rule Evaluation

Given the rules, fuzzy input and output sets, we first calculate the degree of membership for every variable we have to the set that is in the rule’s condition. For example in the “if project_funding is adequate”, we calculate the degree of membership of project_funding to adequate set, and the same for the other condition.

***NOTE: In the exam don’t forget to calculate the equation of the straight lines

Then do the operation between them weather it was an OR or an AND. The output is the same value but in the set in the conclusion, for lets say the value of the conditional was 0.2 then risk will have a value of 0.2 the low set. In the scaling part you multiply each point in the set by the fuzzy value of the output.

Aggregation

After calculating the scaled or clipped output, and we combine them, we don’t add them .i.e. if two curves are are in the same place we take the max.

Defuzzification

The last step is defuzzification, transforming the output value to a crisp real value. The most common method is the centroid method, and we already know it from 3rd secondary year.