Fuzzy Logic - Computerphile
Вставка
- Опубліковано 1 гру 2024
- Real life isn't as simple as true or false - Fuzzy logic allows you to have degrees of truth, meaning computer programmes can deal with more diverse situations.
Home Made Z80 Retro Computer: • Home-Made Z80 Retro Co...
Kernel Panic: Coming Soon!
/ computerphile
/ computer_phile
This video was filmed and edited by Sean Riley.
Computer Science at the University of Nottingham: bit.ly/nottscom...
Computerphile is a sister project to Brady Haran's Numberphile. See the full list of Brady's video projects at: bit.ly/bradycha...
"Temperature doesn't just go from hot to cold"
Obviously you've never used a shower.
haha much true human, that statement is so much correct that you just said.
^ I think it's trying to communicate. What should we do?
jfb-1337 Nor has he ever been in Oklahoma.
More like, he's never used a shower at a remodeled Motel 6!
really? so when you change the temperature of your shower it instantly reaches its final temperature?
The temperature of this water is true.
If the temp of water is 50 , so you have to say is it true or not , so youre wrong by sarcasting the term.
As a perfectly normal human, I realy like drinking perfectly true water, as any normal human
??
I think this may have been better described with an example a bit more tangible, like colors. A good example of fuzzy logic is determining if a color is similar to another. First you break down into the three RGB values, then you have to make sure no individual color is too different by comparing the difference, then you have to take the total differences in all three colors and make sure IT is not too large. :)
diff = sqrt(r_diff^2 + g_diff^2 + b_diff^2)
...
;-)
That is a good example! Thanks :)
more tangible than showing or washing clothes.. I think it's time you thanked the woman in your life
I thought his example was perfectly understandable. All you did was complicate the variables. Everyone can relate to temperature and dirt, whereas RGB values are far more esoteric.
Mat Broomfield Well, the complication of variables was the point. 'Fuzzy logic' is inherently complicated and esoteric.
I've tried many times to explain fuzzy logic to my (laymen) friends, ironically with varying degrees of success. I think from now on I'll refer them to this video. Well done, thanks.
ok?
I'm about 0.3 watching this video, doing work at the same time
+Koya
(MyState==YourState) True
+John von Horn Also, try not to diffract too much when you walk out the door.
+Fin Koya me too
ok?
@@Triantalex It was 8 years ago but I assume what I said made sense
Only A Sith Deals In Absolutes
I love the hypocrisy of that quote.
Ferroneoboron san Hypocrisy? what if Hlias is a Sith?
agun17
I'm pretty sure the original use of the quote imparted a negative connotation on being a Sith.
Ferroneoboron san
Exactly, a con-notation. YOU FOOLS!
+Ferroneoboron Yeah, but it doesn't work if you're already a Sith, because negatives and positives are the same!
"Fuzzify" should be word of the year.
+MapIestrip Maple sounds like a spell from Harry Potter. *raises wond* FUZZIFY!
It's been a year and I'm sad to say it probably hasn't been.
false.
Fuzzy Logic: robotics and A.I. will be impossible without it. (eg. even when I park my car, I don't know the exact distance between my car and the wall; I just know "the distance is good enough")
false.
It sounds like the fizzy set is a percentage of the input in a given range of values. This would allow the rules to be relative and changing the range of the set fundamentally changes the operation of the entire program and its outputs. Genious! Bravo.
Thanks for a new video that leaves me more confused on the subject than I was before!
Good to hear you mention uncertainties there at the end -- such an important consideration. On a different point, I've always believed it somewhat insightful to think about its (fuzzy logic's) semantic contrast (and even its relation) to a probability concept, such as Bayesian inference (essentially, degrees of truth on the one hand, and prediction on the other).
is Zadeh the same guy who also came up with Z-transform and Z numbers?
They neglected to mention that fuzzy logic is far more efficient, robust and reliable than non-fuzzy logic control systems.
Frank Flores He mentions that towards the end
By non fuzzy logic do you mean like propositional logic?
The founder of this logic is from my country Azerbaijan. We are so proud of him
I would have liked to see what that actually looks like as code.
RandInt(x)
Look at matlab fuzzy toolbox for how to code using fuzzy logic and fuzzy inference.
Great vid. Thanks again Brady.
George Edwards thanks for watching (BTW, my mate Sean makes most of the Computerphile videos, so kudos to him and all the cool experts!!!) >Brady
I love all the different paradigms and sub-paradigms in software design!
I would like to see 'Dizzy Logic' where computers support repeat processes based on true events. Eg. If you are changing multiple file names the os would anticpate the process based on the processes that have previously taken place. Or if you copied files into a folder it would rename and sort files into subfolders based on file formats and gives all files and folders a relationship - certainly help keep file structures organised.
These 3d animations are really good!
Funny, I was thinking the exact opposite.
Mat Broomfield
And I was thinking somewhere in between.
I think they're 0.8 good.
seriously guys? the animation is very good, imagine that they were made a youtube video which has 10 min, probably in les then 3 days
are you guys exemplifying fuzzy logic???
Always a pleasure to have an explanation from Joe, and an interesting topic to boot.
Hmmm... I would have explained fuzzy logic exactly the other way round. You have a continuous rang of values, but modelling your systems with these values is too complicated. So, you limit your values to a discrete set, such as very hot, hot, warm, medium, cold, and very cold, instead of a centigrade value. Then your washing machine can easily use them for its calculations!?
Nice
9 minuets + a coherent example...
it took my Tel-Aviv University Professor 3 hours to say the same thing in a confusing and frustrating way
thanks for this vid :)
Thanks for explaining! I always wondered what this fuzzy logic, that my high-end Japanese rice cooker has, was exactly.
I love your interpretation of fuzzy logic.
Its very clear.
Please can you do a video showing how this would work if we were to use fuzzy logic to determine peoples risk bearing level
The explanation is very clear. No trifling things!
As one of the mathy sorts of people, I found this very stimulating - the speaker in this video did a very good job. Cheers!
As one of the logic/algorithmy people I also love this haha.
This guy is a lot better than the text by SMS guy.. A lot more natural
I'll take that as a sign I'm improving ;)
Joe Nash ;)
Joe Nash
You're clear as a bell, mate.
If you were coding this, wouldn't you have to explicitly define every member of a set? For instance if you had a set of pets, but you forgot a parakeet. Your member function would then return that a parakeet is not a pet (or 0.0 petness). How do you get around this? Do you have to use some form of machine learning like he said at 3:30?
And because of that graphic, now we need a computerphile tshirt!
I've learned that the world can be black or white, just so long as you ask the right questions.
Unfortunately it means you have to break EVERYTHING down to binary terms, which can take a single question and turn it into dozens, or even hundreds.
Well, in a way, you can also think of a continuum or gradient as being a huge number - perhaps infinite - of black-and-white choices. Indeed, that's one way to quantify what "information" means: "how many yes/no questions do you need to ask to fully describe this situation?" Moreover, that is also what the binary expansion of a real number - such as that in the continuum [0, 1] - is effectively doing: "Is it in the left half?" If "yes", then ask "Is in the left half of the left half?", and if "no", ask "Is it in the left half of the right half?", and so forth to "Is it in the left half of the right half of the left half?" etc. and each "left" or "right" gets "0" or "1" and thus you get 0.010... (in this example) as the expansion of the number. Adding more bits at the end gives you more resolution, a finer-grained continuum. The fully continuous version requires an infinite number of such questions. So in this sense, indeed, fuzzy and black/white logic are equivalent in that one can be modeled inside the other, but it may be much more profitable in some cases to use the fuzzy logic and the black/white logic obscures things. To me, the best approach is not one approach. It's having as many theories, angles, and viewpoints under your belt as possible to attack things and knowing how, when, and when not to use each.
What's more interesting, in Fuzzy Logic the calculation rules for logical connectives are consistent with Boolean algebra (you get the same results if you restrict yourself to 0 and 1 and nothing in between), but they are different from probability theory, where they are also consistent with Boolean algebra.
Isn't the washing mashine example also just an awful lot of IF's, just running in the background? For example, the "dirty" state of the water is also a boolean and so is the "hot" state. And both of these states are eventually dependent on a set of IF's aren't they? For example someone would have determined that "hot" for the water means that the water's temperature is above 70°C and "dirty" means that the amount of dirt particles in the solution is above a certain level...
No, you can also have "half dirty" or "half hot". The output can also be "half heat" for example.
He specifically says that the same effect can be accomplished that way, but it's not as concise and maintainable as this fuzzy logic.
yes, an awful lot of IFs can sum it up. that's called an algorithm
Exactly what I thought. A rule is only a series of if statements in its own right.
Everything in computer comes down to a bunch of if statements, addition, subtraction and jumping(not-too-mush simplified).
Certainly, you can write anything in assembly operators. But for what? Even 500% increase in performance is negligible if the user can't see any difference.
Each and every branch of programming nowadays is a tradeoff between speed of coding vs. speed of execution, and as time goes on speed of coding becomes much more valuable (hardware is just too fast for tinkering with assembly). That's why you can afford using fuzzy logic, object-oriented programming, late binding and a whole lot of other concepts, that slows down your program but speds up your programming.
Excuse me for the ignorance, but how does this differ from control theory? I mean, the washing machine, train and shower temperature could all be solved within control theory, without resorting to yet another rather -for me - confusing concept
same
Code using standard logic is easily maintainable and kept neat with the use of constant variables.
Is Friday a weekend?
The closer to morning it is, the closer the truth value is to 0.
At 5pm, the truth value is around 0.5.
After 8pm, the truth value gets much closer to 1.
his washing machine is so much more advanced than mine!...
yeah I have a very mechanical Washing machine that's older than me :D
"Fuzzy Expert Systems" is the name of my new line of sweaters.
Interesting stuff. I happen to be taking a philosophical logic class at the moment, and it seems somewhat related.
This seems like pointless semantic sleight of hand. For example, if you want to adjust the spin speed of a washing machine based on the clarity of the water, just write a linear equation relating those two real-number variables. Why build this clunky, unintuitive thing on top of boolean logic when we've already got algebra?
Agree with you 100%, this all sounds like some elaborate hoax.
finally someone talking sense!
Adamantium9001 He answers you question towards the end of the video.
+Anonymous User How? I also don't get it.
You don't need a single if statement for this to work. You would simply measure dirtiness of water [0,1] and then you would define rpm for max dirtiness and simply write that actualRpm=dirtiness*rpmForMaxDirtiness
pegatrisedmice A washing machine is a simple example to explain the concept. The underlying principles go beyond your approach to the example.
You should do something on LaTeX and Donald Knuth!
But if 'nice weather' is defined the Law of excluded middle is applied and makes the statement "It's nice weather" either true or false. So in the end, you have only these two options. It's only a question of how you define things in the statement.
So fuzzy logic is just assigning rules to ranges of values instead of specific values? That's it?
Not arbitrary rules though. It can be thought of as complementary to probability theory. The following excerpt compares the two concepts:
"Fuzziness describes event ambiguity. It measures the degree to which an event occurs, not whether it occurs. [Whereas] randomness describes the uncertainty of event occurrence. ... At issue is the nature of the occurring event: whether it itself is uncertain in any way, in particular whether it can be unambiguously distinguished from its opposite." Fuzziness Vs. Probability - Bart Kosko
I don't get it... Isn't this just the same as dirty being a function? So instead of using certain variables in an if-statement you call a function, say isDirty() that will return true or false?
And isDirty contains something like "if(temp < 30 && lumen < 1){ return true;}"
+salmjak actually it doesnt return true or false (0 or 1), it will return anything between [0,1]. For example answering if temp is warm, if u can see on the white board at 2:33 and wanted to make a function isWarm like the one u mentioned it would have rules kinda like this:
if (temp=5 && temp=15 && temp=25 && temp>35) {return (35-temp)/10}
else if (temp>35 ) {return 0}
What is not said clearly in the video is that each degree of temperature can have 3 truth values for cold warm and hot respectively, i.e temp 10 can have 0.5 for cold 0.5 for warm and 0 for hot. This temp is considered somewhat cold and somewhat warm at the same time !(if u dont like the numbers changed them:P)
In Fuzzy logic operators like AND and OR ( and there are more..:)) will pass on those values. So the actuators of a system controling the air condition can make use of them too
Hope i made things clearer rather than fuzzier :P
How dirty are the cloth which have to be washed?
To which degree do you fill up the barrel?
... instead of ...
Are the cloths dirty or not?
Is the barrel filled or not?
The difference between temp = 29 and temp = 30 is the point here. Or between 29.99999 and 30.0000001 It's very small that you cannot even notice with human sense and it can be even result of measuring error of sensors given by various factors like temperature outside the machine or heat produced inside of the machine by engine or circuits. Even though the difference is so small, it gives so "radical" output true / false. It's maks much more sense to return anything between [0,1] instead.
Not the best Computerphile video IMO. Would have been better if Joe had continued with the water temperature example and had explained how a fuzzy logic or expert system would go about regulating it.
On the other hand, maybe fuzzy logic deserves a fuzzy explanation. ;-)
2:55
Slayer - Raining Blood
Never been comfortable with the term 'fuzzy logic'. The logic is certainly still accurate. Logic is not only about true or false situations, but also about implications and non-contradictions. A thing or state can certainly be or implicate different things at once, you just have to watch out for contradictions.
Say, a day can be hot, wet and sunny at the same time, but not cold, dry and cloudy as well. In turn such a day can implicate different things, like switch on the air conditioner and blinds.
So it's basically a work on ratios of data. It's like driving PWM to LED, you can light the LED at different brightness level, then you can measure an input signal as ADC voltage which is also a matter of ratio. Could this also be an example of fuzzy logic?
Very good explained. Yesterday we wrote an exam which had a Fuzzy-Logic question that was worth 15% of the points. I think i got all right.
It seems that fuzzy control and feedback control are same things; are the?
Like example in the video- detergent added in washing machine is determined by "how dirty" cloths are and the same logic is used in feedback control.
I didnt get it quite: I shouldnt use if statements but switch case? I mean you still have to do something when something happens?
I don't quite understand. Is it mapping the values to something different [to express it in Java (or atleast Processing, which is the only language I know but apparently is almost the same as Java) newTemperature=map(dirtiness, 0, 1, 20, 60)], or is it assigning certain statuses ( if(dirtiness > 0.8){veryDirty = true})?
Species are a great example of fuzzy logic.
What about using a PID to control water temp. If we have some set point that the user thinks is warm, the PID should be able to handle disturbances.
So you're saying they go from an analog value to a digital value through a function to deal with them?
It's almost like modulation and demodulation.
So how is the inference engine and the "fuzzification" any different from the IF functions. The system still has to interpret the inputs and define what they "are" based on certain parameters, correct?
What a nerdy T-shirt... and true also...
My opinion on fuzzy logic:
The membership functions are designed by an engineer without any data but only the knowledge of a problem. When used like this, fuzzy logic would be little more than an architectural choice and does not deserve any amount of scientific attention.
The membership functions are determined by empirical observation - data. This requires learning methods, which probably still retain some attention. This places fuzzy logic between pure classification methods (SVM, neural networks, trees) and probabilistic inference.
Perhaps I lack some understanding, but I don't see why fuzzy logic would deserve interest - more interest than proper machine learning methods. Maybe someone can enlighten me?
So basically, analog values?
seems like that. basically not digital (binary)!
Still digital because we're talking about binary computation. But if we use sufficiently high values (or floating point values), it can serve a very close approximation of an analog system. It's a trick
I kept thinking about A2D converters when he talked about "defuzzyfication".
??
I didn't really understand. Say you have that the water is half dirt half clean, then your "if" statement would require the washing machine stop cleaning and at the same time clean more. How does it decide what to do?
I understand that you can specify actions depending the range of dirt, that's normal programming. But in the video he says that in the case of fuzzy logic those ranges are overlapping. That's the part that I don't understand, what action do you take if you are simultaneously in two of those ranges of values.
joselotl i think the guy in the video means that, in reality, those ranges are overlapping. but in the program, choices are made as to which ranges belong to which set. so if something is half dirty and half clean, the program will still decide whether it is either dirty or clean (but not both).
OK, then I didn't understand how the fuzzy logic comes into play.
joselotl lol and neither do i. he seems to be doing things i would normally do anyway and it leaves me confused too. i'm guessing that his explanation is flawed.
How does it feel to feel ?
You don't identify who is speaking in this video or in the comments.
Joe Nash of Nottingham uni
Could you please answer this question-why fuzzy concept is considered an extension of classical logic
hello everyone
can i get some paper or some books about Fuzzy logic & thier application on image processing PLZ??
I've recently taken my first foray into this (using LabVIEW, though guess the platform isn't important), and took ages to understand the point of it - why not use something like a PID controller? Then suddenly I twigged, and feel like I've seen the light - and the light is fuzzy! Looking to build an ignition advance controller for my Mini now :)
from what I gathered from this video, "fuzzy logic" is simply a name for measuring something, and outputting a 1 or a zero depending on if the measured value cross some set threshold. Am I missing something here?
Yes, you are. You see, any logic system has things like Conjunctions and Disjunctions, Implications, Formulas and their values. So if you look more into it, you might learn how to A&B if A is 0,3 and B is 0,5. Or what is Not A? It's 0,7, because 1-0,7=0,3. They just don't talk about the actual formulas of logic in there video
Oh wow I am in my last year of university and I have a subject called "softcomputing's application" and it is about ANN, fuzzy logic and genetic evolution. (They use something called xfuzzy)
But "nice" is always subjective, meaning that it is defined by prior experience. What you find nice is determined by how it compares to the prior experienced states of things. But by finding something "nice", you still ask the same question, even though it is answered through different logic reasoning. Because by asking if someone finds a thing or state "nice", you merely ask him to compare it, but not for the base on which he grounds his answer.
nothing was really explained i want to know how things are fuzzified not just that they are
What is the difference between a pid system and a fuzzy logic system?
IMHO, the presentation would have been clearer if you'd have started with the washing machine and used it throughout, instead of starting with a shower, then switching. Also shower mixing valves mix hot and cold water from 100% cold with 0% hot, to 0% cold with 100% hot (subject to a maximum safe temperature limit). The math is very simple and there's really not much fuzzy logic required.
Really helpful! Great job explaining it!
could someone please tell me what laptop is that ?
Fuzzy Face Logic. Well done, sir! Great video!
I could break every thing you said down to two decisions. Ultimately the world is not 'gray' but is discrete. An electron can exist at one energy and move to another with no gray area. I think giving the users the best visualization w the collection of true/false decisions is what you are trying to get at
So we need to do EXPERIMENTAL DESIGN to get the FUZZY SETS, then defuzzy it to get OPERATIONAL SETTINGS.
Is that correct?
😢
so is fuzzy logic basically how one would make a controller with say, an arduino, without using some sort of mathematical model, but instead using boolean logic?
You were correct. I am in England and it's chucking it down!
Great video. Great explanation.
How about some references to suggested reading etc (on all videos) if possible?
For some reason i read Fuck logic. Probably because of the finals.
So basically it's just separating the comparison into it's own function so you won't repeat yourself?
I an not a big computer science expert but isnt any complicated piece of code if fuzzy? I mean, the more conditions you have and the more cases you cover the fuzzier it becomes? so any code that have more than a simple if statement is fuzzy?
any idea how should begin with it in air pollution monitoring?
Watching Computerphile with only one eye opened; where's your logic now?
The weather in England is actually beautiful today for once!
i want to watch the kernel panic video so bad!!!
just edit it already!!!!!!!!!!!!!!!
I misread the title as Funny Logic.
Sorry but no washing machines are using a bunch of IF statements, that's ridiculous. Most control is done using PID which uses analog inputs from various sensors and sends an analog output based on the PID equation. Fuzzy logic does tend to respond a bit faster than PIDs but the gain is marginal and not worth the hassle in most rudimentary systems.
Yesterday, I didn't use my fuzzy logic so I tripped my scooter and I hurt my left elbow.
Even though he capitalized "IS" and "THEN", he really should have identified it as a capitalized "IF" at the start, because he's making [IF, THEN] statements, which is less fuzzy than he's trying to make it sound.
He wrote IF
Schmit trigger is the perfect representation of fuzzy logic stands!
Wow, fascinating! I like this much better than a block of if's. It's much easier too!
I hope you got money from Harvey Nash for the great advertisement..
Isn't this basically object oriented programming? Instead of writing a bunch of long if statements all over the place, having "fuzzy sets" that have pre packaged rules? Objects right?
I can see an Atari Falcon in use... I'm moist at the prospect...
where can I get that shirt?
So, it's kind of "fuzzy logic" in itself deciding how good a particular fuzzy logic algorithm is, huh?
I'm not sure how these fuzzy if's work at a fundamental level. What is the computer searching for?
then Fuzzy logic is just a map from real value to (0,1)? why not work on the continuous variable directly?
I am a male and I have always been heterosexual, but this guy gets to fuzzify my crisp values.