Fuzzy Logic - Computerphile
ฝัง
- เผยแพร่เมื่อ 10 มิ.ย. 2014
- 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/nottscomputer
Computerphile is a sister project to Brady Haran's Numberphile. See the full list of Brady's video projects at: bit.ly/bradychannels
"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'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.
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.
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.
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
So lots of people liked this video? But if all you can do is either Like or Dislike it, it isn't possible to tell just how well the video was liked. TH-cam's rated "quality" is a straight forward calculation: Rating = Likes / (Likes + Dislikes).
What this doesn't tell us is "how much" someone liked or disliked it. If TH-cam used a star rating, where the viewer can select 5 stars for "great" and one star for "poor", fuzzy logic would be automatically inherent and a more accurate rating would be computed.
Using a simple Like/Dislike rating system requires a lot of votes to give you an overall feel to how much a video is liked. I suspect that if a star rating were used, the bar graph showing how well this video is liked would be different.
Humans shouldn't have to be forced to choose either Like or Dislike. Most people can generally convey their feelings about something in 5 levels:
1 - Hated it.
2 - Didn't like it
3 - Was OK
4 - Was good
5 - Was great
As an example. With TH-cam's rating system, if one person Liked this video and one person Disliked it (and only two voted), then the average rating would be 50%. But if those same people could select a star rating and one person gave it 1 star and another 3 stars, the average would be 2, making the overall rating less than 50% and thus more accurately reflecting how well this video was liked.
At least with TH-cam you have 2 choices of like-dislike comparing to Facebook were everything is only likable...and i dislike that
Actually you can tell how much a video is likable. Use "Ratings Preview for TH-cam" plugin and enable "Show RP score for every video (from 0 to 10)"
Wow.Thoughts nicely put
@Mohamed Haddi They changed it because the vast majority of votes were either 5 stars or 1 star, so averaging that wasn't particularly helpful in most cases. Switching to a Like/Dislike system allowed for a few things: The bar that showed percentages of each vote would be clunky with 5 options (and the interface in general had more options), a Liked Videos playlist was added, and no less importantly, Google wanted very badly to have the next Facebook.
It needed 6 bits before I gave a thumb to this comment. Now it needs 7.
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).
Always a pleasure to have an explanation from Joe, and an interesting topic to boot.
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")
Thanks for a new video that leaves me more confused on the subject than I was before!
I love all the different paradigms and sub-paradigms in software design!
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.
is Zadeh the same guy who also came up with Z-transform and Z numbers?
Thanks for explaining! I always wondered what this fuzzy logic, that my high-end Japanese rice cooker has, was exactly.
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
The explanation is very clear. No trifling things!
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?
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.
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
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 :)
Interesting stuff. I happen to be taking a philosophical logic class at the moment, and it seems somewhat related.
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.
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})?
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?
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???
How about some references to suggested reading etc (on all videos) if possible?
I didnt get it quite: I shouldnt use if statements but switch case? I mean you still have to do something when something happens?
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.
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 :)
Could you please answer this question-why fuzzy concept is considered an extension of classical logic
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.
Code using standard logic is easily maintainable and kept neat with the use of constant variables.
Really helpful! Great job explaining it!
And because of that graphic, now we need a computerphile tshirt!
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.
What is the difference between a pid system and a fuzzy logic system?
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.
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.
hello everyone
can i get some paper or some books about Fuzzy logic & thier application on image processing PLZ??
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?
Great video. Great explanation.
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.
"Fuzzy Expert Systems" is the name of my new line of sweaters.
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".
could someone please tell me what laptop is that ?
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.
any idea how should begin with it in air pollution monitoring?
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
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?
Brilliant video!!!
Hey! How did you do in SpaceApps? I entered too :)
It sounds to me like the coding used in fuzzy logic bears a strong similarity / compatibility with OOP. Where 'Fuzzy Set' ≈ 'Object', and 'Membership Function/Rule Base' ≈ 'Methods'?
Because it was an example on how you would define these rules in OOP, no actual code for the fuzzy sets or membership functions was shown.
Thanks for the explanation!
where can I get the t-shirt?
GREAT VIDEO
How does it feel to feel ?
Wow, fascinating! I like this much better than a block of if's. It's much easier too!
You were correct. I am in England and it's chucking it down!
So we need to do EXPERIMENTAL DESIGN to get the FUZZY SETS, then defuzzy it to get OPERATIONAL SETTINGS.
Is that correct?
😢
his washing machine is so much more advanced than mine!...
yeah I have a very mechanical Washing machine that's older than me :D
You should do something on LaTeX and Donald Knuth!
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)
Great explanation thank you
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.
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
Species are a great example of fuzzy logic.
i want to watch the kernel panic video so bad!!!
just edit it already!!!!!!!!!!!!!!!
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?
Can we have a video on big data ?
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
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.
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?
What a nerdy T-shirt... and true also...
The weather in England is actually beautiful today for once!
Great video!
Yes because you can really watch a 9 min video in 1 min right?
Jimmy L lol
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.
The founder of this logic is from my country Azerbaijan. We are so proud of him
thank you for very useful explanation :)
Fuzzy Face Logic. Well done, sir! Great video!
I'm not sure how these fuzzy if's work at a fundamental level. What is the computer searching for?
Schmit trigger is the perfect representation of fuzzy logic stands!
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.
I always see fuzzy logic contrasted to binary logic. As if using more than one bit to make decisions in a computer was a complete revelation at the time. To me, without being an expert in fuzzy logic, the main feature of fuzzy logic is that it uses probabilities while the systems are still quite comprehensible _for humans_, and if it's only the developer of the expert system. So it's not that the computer is restricted in this case, it's us. _We_ can't handle neuronal weights or high-dimensional support vectors and still see what's happening in that washing machine.
ok but unfortunately no one asked
Gotta like the Keep Calm and Code shirt
I see Joe is going for a 'fuzzy' look himself. Nice beard mate!
then Fuzzy logic is just a map from real value to (0,1)? why not work on the continuous variable directly?
2:55
Slayer - Raining Blood
His macbook air looks just like mine! Lots of nerdy stickers!
ممكن اتواصل مع صاحب القناة
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?
"Keep Calm and Code"!!!
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.
Elephant & castle is on the map , but where is the map ?
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.
Nice Twilio sticker dude!
Watching Computerphile with only one eye opened; where's your logic now?
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.
So it's like probability?