Showing posts with label aiclass. Show all posts
Showing posts with label aiclass. Show all posts

Monday, February 13, 2012

AI Class RIP -- My Final Review

By popular demand (i.e., my friend Jen) here's my final comment on Stanford's online Introduction to Artificial Intelligence class. It appears that things went so well for the professors that one (Sebastian Thrun) has resigned his tenured position in order to found an online "university": http://www.udacity.com/. For various reasons I will not be participating.

After it was all over, but before the fat lady sang the grades, this question was posted on the forum site:
Did the top students find the questions ambiguous?

This forum keeps talking about the ambiguous questions. Perhaps we should be asking “ambiguous to whom?” My hunch is that the top students didn’t find the questions ambiguous, although I could be wrong. To test my hypothesis, perhaps Irvin and the Profs could give some data to work with, and we could (or they could) test this statistically.

Define a “top student” as a student who achieved say 90% or more on the mid-term (or mid-term + homeworks perhaps). Then look at how many got the “ambiguous” questions correct before the alternate solutions were accepted, vs. the non-top-students. If my hunch is right, it will be the non-top-students who found the questions ambiguous, which tells its own story.

It will also mean that the top-students’ rank overall won’t change too much from the introduction of the alternate solutions, as it will lift all those who got say 80% or less to say 85%. The ranking of students up above 90% won’t change a great deal.

Just a hunch.
Well. I managed to eek out a 96.5% (thanks to a reversal of answer fortune on one of the so-called ambiguous final questions where "they" gave in and accepted both answers as correct). This only put me in the top 25% of the class(!!?). Tough crowd. Here is my reply to the above. (It attracted not a single discussion comment nor have I seen it displayed in the blurbs for subsequent classes):
I too (believe that I) am in the 90%. I found many ambiguities in the lectures, homework, and exams. And I found each one very annoying because I felt I was being graded on how well I could guess what the professors really meant (why I cared about a grade is still a bit beyond me...). My general feeling is that grad students should have taught this course because they are closer to the assumptions being made, senior researchers are bound to "forget" that, e.g., their definitions of Stochastic or Partially Observable are built up over many years of experience. From the beginning certain things were not clearly defined, vis "Rationality" which was only mentioned in the summary of the first video lesson.

My biggest problem with this course was the inability to get answers to questions from definitive sources. First there was no real forum to ask them, and then when aiqus came on line, almost every question went unanswered because it related to open homework or exam questions. I finally realized that there is no point in taking a class where I cannot ask questions and am unlikely to take another online course because of that.

As an example, I got on the wrong track with Particle Filters early on and it was only by dint of repeated reading and listening that I stumbled on the right one. And the only way I knew that I had finally gotten close was that I got the exam questions right. A TA in a study group would have been able to correct my tangent in about 5 seconds...

The chief thing I learned in the class was that I am not very interested in Artificial Intelligence. I discovered that there are sister fields, Computational Intelligence for one, that are more in line with my interests but each has an academic rivalry that keeps them distinct. For instance, there were a couple references to RA Brooks early robotics work (in the book -- I forget if it came up in the videos), especially the 1991 paper "Intelligence Without Representation", which were somewhat dismissive -- because it seems that our professors are still more aligned with the symbolic AI school of thought.

Perhaps if this class had been a survey of the broader field rather than a (kind of) detailed study of specific techniques I would have found it less frustrating. One of my friends who was auditing the class said: There's a bunch of "Oh, that's how they do that" moments but it's missing the big picture.

Sunday, December 18, 2011

AI Class 10 -- My Final Answers...

Thank god it has come to a close. I put my answers in and checked them twice hoping that Santa will be nice. (No you don't get to see them until the window closes -- extended by another day which I am going to ignore.) Since I have put it all behind me, I figure now is the time to complete my whining ...

There are 59 little boxes to be filled in correctly or not, and as I might have expected 16 of those involve using the hated IMPLIES (=>) logical operator -- who's only use I have been able to ferret out is to be able to tell someone he is a liar once you've discovered that fact ( T !=> F). But thanks to a friendly co-student who pointed out the logical equivalents table on page 249 of the (mostly irrelevant to the course) textbook, I now have no fear of the Implications.

As usual there are a couple of just impenetrable questions for which no clarifications seem to be forthcoming. The most amusing of these is on Planning (at this juncture I should mention that I also hate Planning and Scheduling because it brings back PTSD memories of being repeatedly forced to Plan and Schedule un-plan-able R&D tasks in one of my former lives) where we are given a list of Actions with Preconditions and suchlike and a list of possible Resources that we might have at our disposal, then asked which Resource sets will satisfy the Plan. However the voice-over description of the problem seems to interpret one specific Precondition in two ways, either needing exactly X of something or needing at least Y of something else. The amusing part is that all this formal Planning and Scheduling (crap, not to be pejorative or anything) is supposed to remove the ambiguities from the process.

And five (5) more questions about basic geometric optics and cameras -- if you didn't understand it in high-school physics you are not going to get it now -- so I guess they are there to boost the test scores. So I guess I'll probably mis-copy some answer again and fail them.

On the plus side, the first question is about the Tower of Hanoi puzzle which my grandfather made for me and I solved when I was about 10, and only one of those little boxes reeks of ambiguity so I should have a couple of gimme points there.

So...post game... I was barely inspired by this class and that mostly by accident. As one of my friends who was auditing it said, it's more of a "Oh, so that's how they do that..." set of disconnected topics than a coherent presentation. This may be necessary in an introductory class, especially one meant to be technical rather than a survey. But it leaves me feeling that I now know a smattering of Artificial Intelligence with an emphasis similar to that of Artificial Ingredients rather than anything about Intelligent Behavior.

Thursday, December 8, 2011

AI Class -- Homework 7...argh...again...

Oops, I did it again, Britney... Copied a number off my worksheet incorrectly and missed an easy question. One of the GDM algebra questions I was whinging about last time. But not even an algebra error. Oh well.

However this brings me to preview my post-game analysis. While I have learned a lot of "interesting" things and have some appreciation for the effort the professors put into this, I have a few issues with this class and the medium in general:

  • Technical stuff -- I guess mostly unavoidable, but hey, these guys work for Google man...
    • Crashes and hangups making the videos inaccessible and delaying the homework. Better now but still not perfect;
    • YouTube playback: If you pause the video the headings and controls cover part of the screen so if you want to do a screen grab you have to slip it in while the video is running and the instructor's GDM pen is not waving over the stuff you want to grab. Also if you miss pausing right at the end of the video you have to go back and reload everything. And really annoying, to re-view the Quiz Explanations you have to re-take the Quiz or else learn to maneuver through raw playlists somehow.
  • Online Pedagogy -- The medium is/was not quite ready for Prime Rib...
    •  Sometimes the lesson videos are not clear, and sometimes they are just wrong. If I was in a classroom I could wave my hands around and ask, "What did you really mean there? Did you mean Min but say Max? Or did I mis-apprehend?" Usually the mistakes are corrected with text annotations and the corrections are appearing in a more timely manner, but you just never know. I guess it keeps me on my toes;
    • At the beginning there was NO feedback mechanism. If I had a question or brain-fade on something there was no way to get clarification, except from other students who might be just as clueless. Now there is a forum which some apparently official folks monitor sometimes, so, if I can phrase a question correctly I have a small chance of getting an accurate explanation. Part of the small is that most questions seem to overlap with the Homework or Exam questions and thus can't be answered until after the fact.
    • That homework thing... Jah, I make stupid mistakes. If there was a recourse I could possibly make the point that it was a stupid mistake and get some credit for at least thinking correctly. Of course I still can't figure out why I care about getting a grade anyway.
  • Style -- Some things are just annoying...
    • Definitions. Definitions. Definitions. Especially Partially Observable Stochastic Rationality. I'm still not sure which way the wind blows on some of that because the definitions are, and are admitted to be, a bit arbitrary. The one that still galls me is calling a card draw Partially Observable (rather than Stochastic) because the deck is already shuffled but in an unknown order -- so reshuffle the deck each time, eh? Then being graded on my understanding;
    • I mentioned Professor Thrun's habit of using lecture Quiz questions to introduce the next lesson rather than reinforce the current material. This is supposed to encourage me to think for myself. It doesn't;
    • I also mentioned his delight in tedious arithmetic. I'm really not sure if there is a better way to pound in the concepts. I do understand more of what I'm doing now, so maybe tedium works;
    • I think many explanations would have been clearer if the class was taught by a grad student who was closer to the horrors of learning it for the first time. For me, Logic, Planning, and Particle Filters were explained in a rather high level manner and then Homework or Exam questions asked for specifics and mechanics that were taken for granted.
Anyway, it's continuing to be a learning experience so I guess it's not all bad.

Thursday, December 1, 2011

AI Class 7 -- Homework is pissing me off...

I find it a little hard to believe, but 1/3 of the current homework questions are about doing basic high-school algebra using equations for stuff that is only peripherally relevant to image processing technology. (Ok. Ok. They are all about cameras and focal lengths and such, and maybe if I hadn't spent years peering through a 4x5 view camera I could get -- positively -- excited about them). I would treat them as gimme-points except I'm likely to make some stupid transposition error and fail them all.

I guess it really is an artificial intelligence test (emphasis mine).

Plus there's a question about image convolution who's answer seems to depend on being able to correctly interpret a mumbled-aside comment in the relevant videos combined with prior-knowledge of how it actually works in the so-called real world (or maybe I'm over-thinking again?) Getting that one wrong will cost me another 1/3 of the total score.

But the real question is: Why do I care?

Wednesday, November 30, 2011

AI Class 6 -- Game Theory

The Prisoner's Dilemma

Here's the scam: Alice and Bob are arrested and separately offered a plea bargain for testifying against the other. The payoff to each of them is different depending on what the other person does (we call refusing to testify Cooperation and ratting the other out Defection):
  • If both Cooperate, they both get off Scot Free;
  • If both Defect, they split a small penalty;
  • If one Defects and other Cooperates,
        the Defector get's a small reward,
        the Cooperator gets jail time.

This is encoded in the Prisoner's Dilemma payoff matrix:
                    Alice:Defect  Alice:Cooperate
     Bob:Defect     A=-1, B=-1    A=-5, B=1
     Bob:Cooperate  A=1,  B=-5    A=0,  B=0

(Note that this is not a zero-sum game because the payoffs don't add up to zero...but I think that's a different story.)

There are three standard Strategy types in Game Theory:

Dominant  A move that does better than any other, no matter what the other player does. In this case it is Defect because, if Alice Defects she will get -1 (versus -5 for Cooperating) if Bob also Defects, or 1 (versus 0) if he Cooperates.

Equilibrium  Neither player can benefit from making a unilateral switch to a different move. In this case the Equilibrium is Both Defect because, either player will have a worse payoff if they change to Cooperate on their own. This is the Nash Equilibrium, named after John -- A Beautiful Mind -- Crowe...

Pareto Optimum  Both players agree that they are getting the best payoff they can. If either player gets a worse payoff by changing moves it is not an Optimum. Both Cooperate is the Pareto Optimum for Prisoner's Dilemma because they both get 0, but one will get -5 if the other changes to Defect.

So, in general, if Alice doesn't trust Bob and thinks she will never see him again, her best option is to Defect: Even though there is the possibility of getting a slap on the wrist, she doesn't risk getting thrown in the slammer. But if you play this game over and over with the same person, Defecting leads to a worse over-all outcome for both players than Cooperating. Therefore, if you trust your partner to not bail on you, you should both play the Pareto Optimum.

The problem (a talk on this topic is what inspired my GI's Dilemma kinetic sculpture) is this: If you know the number of plays you will be engaging in, it is tempting to Defect on the last play in order to get the reward and a slightly higher over-all payoff. Of course your opponent also knows this, so you need to Defect one play earlier to catch them out. This strategy cascades down through the plays and often makes it impossible to ever play the Pareto Optimum.

The strange thing about this is that it leads to a much worse over-all payoff for both players. And this is what is called Rational in AI...

So my question is, just what exactly is Rational? Is it covering your ass? Or is it getting the best outcome? I wonder if Rational robots would be able to see past the infinite-regression of cascading Mutually Assured Defection to a landscape where Optimal Cooperation was just assumed?

Monday, November 21, 2011

AI Class 6, Midterm Exam: !!100%!!

I guessed right on the Philosophy (both the questions in my previous post were True because in a completely random Environment any Agent behavior is considered Rational -- great to find that out during the Test, eh?), tortured the Logic to death in the correct way, and stumbled in the right direction through the Conditional Independence exercise. Hard to believe but apparently True: What's the Probability of that?

As an after-the-fact proof, here's the Exam and my notes with the answers I decided upon...

AI Class 6, Midterm Exam...ugh

Actually the Midterm is not so bad really...but maybe I should wait until the scores come out before saying that.

It does get off to a rough start with a couple of true/false philosophy of set theory questions:
  • "There exists (at least) one environment in which every agent is rational."
  • "For every agent, there exists (at least) one environment in which the agent is rational."
Which seem to be throwing folks into un-bounded loops. It may be that they are actually Logic questions in Agent/Environment clothing. As I noted before, the word "rational" was only used in the summary of what we learned in lesson one and the only way we would have learned its meaning was by inference. Added to this is the fact that the scope of all possible Agents and Environments is not defined anywhere that I can find: Does it include the empty set? If so, what would be considered "Rational" behavior? I guess we'll find out when the Exam is graded.

Otherwise the questions are pretty well specified and -- again modulo my jumping the gun -- don't require a lot of tedious calculation ala Professor Thrun's video pleasures. But let me just say now, "I hate Logic", so that when I fail all 6 sub-parts of Question 12 I can also say, "I told myself so". I tried to use the demo code's DPLLDemo.java to validate my mental gymnastics and got different answers based on the formatting of the questions. So maybe it's even beyond the abilities of the computer to solve -- or else I should start filing bug reports.

At the half-way mark we finally seem to be getting into interesting territory with Markov Models. This is what I tried to do at SFI those many years ago so maybe I'll come to understand what I was on about then. But in general I think I've discovered an unfortunate truth:

...I don't actually like Artificial Intelligence...

The trouble is, so far in this very basic class, AI is being used to find simple -- validated -- solutions to fairly complicated problems, generally using the excruciatingly tedious iterated algorithms for which computers were invented. But what I'm interested in is getting Complex results from Simple systems. And that is my working definition of Complex: it is not Complicated for that very Simple reason.

But I guess it's a good thing to torture myself with the Complicated for a while so I know what I'm not missing....

Wednesday, November 2, 2011

Naturally Stupid II

GDMIT, GDMIT, GDMIT...I got 87% on the last AI Class homework because I mis-copied one number which threw off the Linear Regression calculations -- I did all the work right, just got the wrong results.

If this was not the automated educational automat of the future I could probably go to the professor and plead my case and maybe even get half credit for being dumb but not stupid. Instead I need to learn to act more like a computer and not make mistakes.

That being said, if you want to see how I managed to get the hard parts of Homework 3 correct, get the spreadsheet here. Note that I've corrected the mistaken regression number so the calculation matches what the computers at Stanford believe.

Monday, October 31, 2011

Naturally Artificial Intelligence

To illustrate the Abstraction issue I raised in Learning....Slowly, here are a couple of examples from my study of probability. To lay the groundwork, there are three basic operations OR, AND, and GIVEN and for the most part they are defined in terms of each other in a tight little tautology -- see my terminology summary here. Every time I tried to figure out what they _really_ did I ended up in some kind of sink-hole-loop. This was exacerbated by the only two fully worked problems in the AIMA textbook where the behavior of OR and AND distinctly diverged from the definitions.

So I tortured myself for about a week with: "What are they trying to tell me?" Then I took a couple of showers...

The first problem was OR. The definition summed up a set of values and subtracted the AND of those values, but the book example just summed a buncha things and was done with it. After the first shower I realized that the AND part was there to eliminate double-counting of certain values and that "they" has silently elided it because "they" had also silently elided the actual double count that would have been subtracted out. A little note to that effect would have saved me a week's worry....maybe.

The second problem was AND. The definition shows a product of values, i.e., multiplying them all. The book example showed a sum... Well, WTF?! I went around and around on that and complained to anyone who showed any semblance of interest -- where such interest died fairly quickly with no positive results. During the second shower it occurred to me that I had only seen addition in one other place in this whole mess, and that was in calculating the Total Probability of a set of variables. Since probabilities were usually specified as Conditionals -- the probability that X is true GIVEN that Y is known to be true -- this involved multiplying a buncha values (one for each variable of interest) which were "conditioned" on Y being true, then multiplying a buncha different values, conditioned on Y being false, and then SUMMING the results... Eureka! That's what the (fkrs) were doing in the book: The values they were working with came from a table where all the multiplying had already been done, so all they had to do was add them up. Jeez, maybe just another little note would have been in order? Or maybe I wasn't supposed to be looking at it so closely?

So...The point is, my (slightly) Intelligent Behavior was the result of hot water....no, no, it was the result of having a higher level view of the problem and seeing patterns that were not apparent in the details. This is what I'm trying to call Abstraction. Of course this "ability" is probably the result of billions-and-billions of mindless iterations in some very low level neural processing, just like looking at a map integrates a huge amount of visual information with a huge amount of "common sense" information to come up with a route. And this is what Krakauer was trying to get at in his talks: What we really want to call Intelligence is so far and above what our poor little machines are doing these days that the scales need to be re-calibrated all the way down.

Friday, October 28, 2011

AI Class 3, Learning...Slowly

Well. I survived last week's class and got 100% on the homework!! Part of this was due to a sudden realization that the demo code I had been so assiduously analyzing actually contained the skeleton of a system for answering three of the questions. And part was dumb luck, tempered with reason of course. The realization part happened after I had worked out the problems on my own, but I used the software to validate my answers -- which were, amazingly but truly, correct.

The original estimate for time to be spent on the class was a glib 1-10 hours a week -- it's not clear if that included watching all the video lessons which are at least 2 hours a shot -- and maybe some go-getter StanfooFrosh with all their god-given brain cells still intact could do it. Me? I'd say 50 hours last week trying to intuit the inner workings of Probability...

This week -- Machine Learning -- I got off easy. After only three days I believe I'm done. Or else I've missed something really important. Those days include time spent shuttling around finding working internet connections -- because my usually-fairly-almost reliable LCWireless coop took a big poop right after the videos were posted on Tuesday -- and summarizing the lessons for an online study group which meets Thursday evenings. In the course of the summary I discovered that I had developed a simplified method for working the hard parts of the homework (which I _might_ reveal after entries are closed next week). In keeping with standard practice only the first of the two lessons had any relevance to the homework. So now I'm living with the sneaking fear that the exams will cover the missing lessons.

As has been pointed out a number of times: Why do I care about my grade? I dunno. Knee jerk reaction to jerks I guess.


Moving on to the philosophy portion of our time here together....One thing I've noticed about the class so far is that it makes heavy use of exactly what computers are good at: Mindless Iteration.

First we had Search which is just opening doors and walking down hallways until you stumble upon that which you were seeking. Admittedly there are some shortcuts. And even some automated ways to discover the shortcuts. But it's really just wandering around in a big field without your glasses.

Then there was my bugaboo, Probability. This boils down to multiplying and adding big lists of small numbers. Over and over. It's something that Professor Sebastian seems to pride himself on being able to do, but god help me, that's why we have computers isn't it? Of course one does need to be able to set up the problem and understand the necessary transformations -- and the results, which are in many cases "not obvious" -- but that's Systems Analysis.

And this week, Machine Learning. Many of the problems presented make big use of Probability so it goes without saying that there's a lot of repeated number crunching. Moving on to Regression and Clustering, to para-quote: "Often there are no closed form solutions so you have to use iteration." All manner of try-try-again-until-you-succeed perseverationist algorithms are put to use. Gradient Descent is just bumbling-around-in-a-field search with a proviso that one always bumbles down hill. And we haven't even addressed non-local minima yet.

So my question: Is this Intelligent behavior? In one respect, once a computer finds a way to do something we used to pride ourselves on, we always diss it by saying, "Well, that's not _really_ intelligent after all now is it?" But in another respect I think number-crunching may be going about it wrongly. In the map problem used to introduce different types of searching the question was how to get from Arad to Bucharest -- which is probably easier if you are in Romania  A human would look at the map, squint their eyes for a couple seconds, and then go, "Yah shure, we gotta go through Rimnicu." The computer however tries all the possibilities...in the "less intelligent" versions it even goes the wrong direction, just to, you know, see...and then finally pretends that it has discovered a route.

What the computer does is wander around in the field until it trips on the solution, but what the human does is some kind of integration and abstraction of the data. I think this ability to Abstract is at the core of intelligence. We may get to some bits of that in this class but it's gonna be some rough iterations.

Friday, October 21, 2011

AI Class 2, Probably

(I realized my numbering scheme for these posts is bad, so I'm going to use AI Class N, where N is the week.)

Anyway... Week 2 and counting with 10% of the class under my belt.

I missed one question on the first homework -- after receiving actual clarifications-from-on-high vis the ambiguities, some of which were significantly different from the assumptions I was making. What I missed is the idea that, for an environment to be "Completely Observable" requires that the agent use no memory of previous states. Which, IMHO, is a little strange, since it was pointed out that chess and checkers need one bit of memory to determine who's turn it is next...But there's no point in arguing with two-dimensional-video-professors, so I guess I will Just Let It Go.

Now well into Week 2: Probability: Our two new video-Lessons were posted a day late due to crashes in the homework system from the previous week AND after three mostly full time days I'm still only half finished. So I am calculating the priority of my posterior, i.e.: it is kicking my asp. I suspect that my chance of completing the class is 1/N as weeks progress. Fortunately it seems that the homework only requires the absorption of the first of the two Lessons, and that only one of the six questions requires the full-press-calculations that the prof -- Sebastian Thrun -- so gleefully dragged us all through. Repeatedly.

As per established process the first Lesson was a (long) set of short videos each explaining a concept, followed by a quick quiz question. And in keeping with tradition, most of the quizzes were used to introduce the next section rather than reviewing and using what was covered in the current one. Sometimes a quiz introduced new notation and concepts with no explanation. I finally realized that entering random answers would move things along so I could get to the point. Occasionally a question could be answered by grinding through the material at hand, so that does make the occasional correct answer a thrilling Thank God! moment.

We now return to our original programming: Unit 4 -- Probabilistic Inference. Oy.