aimacode / aima-javascript

Javascript visualization of algorithms from Russell And Norvig's "Artificial Intelligence - A Modern Approach"
http://aimacode.github.io/aima-javascript/
MIT License
544 stars 219 forks source link

4-Beyond-Classical-Search #58

Closed redblobgames closed 5 years ago

redblobgames commented 7 years ago

Let's discuss visualizations and code for chapter 4 here. What are the main ideas from the chapter that could be turned into interactive/animated visualizations?

redblobgames commented 7 years ago

For showing a search space, you could use a 1d space in a 2d plot, or a 2d space in a 3d plot — you may look at the three.js library to see if a 3d plot is easy to make in it.

Ghost---Shadow commented 7 years ago

I often just look at the Python branch before approaching a problem. It is always easier to translate from python to javascript than pseudo-code.

Here are the algorithms in Chapter 4 as also listed in the python branch.

4.2 Hill-Climbing 4.5 Simulated-Annealing 4.8 Genetic-Algorithm 4.11 And-Or-Graph-Search 4.21 Online-DFS-Agent 4.24 LRTA*-Agent

Some of these are done but quality control maybe lacking. I am not sure how are you going to implement 3d into these. 3D hill climbing? Possible. What else?

Rishav159 commented 7 years ago

Working under GSoC, I have added several visualizations under chapter 4. The following visualizations are now present:

There are few visualizations left. I will try to come back to them during the final month of the GSoC period.

Few ideas for the remaining visualizations in this chapter:

redblobgames commented 7 years ago

Feedback from someone I showed this chapter to:

Rishav159 commented 7 years ago

Simulated annealing diagram was confusing, as it already found the best value when he hit Restart and it didn't seem to have to search anymore.

I have not encountered this problem yet as if I press restart, the slider changes back to highest temperature and the diagram keeps searching. Although, I agree there are several problems with the diagram. The algorithm is difficult to demonstrate using state space diagram like the hill diagram we have used. Also, we have made several inconsistent assumptions (for example, by setting width to 100%, each state is now directly reachable from each state). I will need to rethink the way we are demonstrating the diagram.

The temperature change was confusing, as it says to change it, but doesn't give you guidance on how much or how quickly.

We could simply mention that it needs to be slowly changed, or we could provide some other sort of feedback, but I believe it would not be useful until we follow up on the other flaws of the diagram.

redblobgames commented 7 years ago

Agreed, we can revisit this when/if we redesign the diagram.

nervgh commented 7 years ago

Hi everyone!

I'm reading the book and I've reached this chapter :smile_cat: I see that you've done great work :+1:

I could help with something if it needed. But I don't know where start from. I've created the task list for more comfortable tracking of status of this chapter (I mean as I see it).

  1. Is it status correct? May be I'm wrong...
  2. Could we move this task list in the first post of this issue? example

Thank you =)

nervgh commented 7 years ago

@redblobgames , @Ghost---Shadow ping =)

redblobgames commented 7 years ago

@nervgh Let's ask @Rishav159 as he was the last one working on this chapter and can suggest what's missing or needs work

Rishav159 commented 7 years ago

@nervgh The reason we do not have a fixed task list is because the tasks are not that well defined. We might need multiple diagrams to demonstrate a concept and sometimes, a concept doesn't really need an interactive visualization at all ! Although, I agree starting with a list like this is a good way to start off. For this chapter,

Good luck!

redblobgames commented 7 years ago

@Rishav159 Thanks! Good starting point. I agree, we don't know what the page will have so it's hard to make a good task list. A lot of this will require experimenting. Sometimes there won't be any good interactive visualization for a concept (we may not be able to find something that's better than the explanations in the book).

nervgh commented 7 years ago

@redblobgames , @Rishav159 thanks!

I agree that we don't have to have a fixed task list. That might be dynamic =) For instance, we have a chapter which contains few concepts (algorithms). At this point we already know what we should visualize. May be we do not know how to do that, but we know that we should do it. And our task list should mirror it (for example):

It may be useful for new contributors like me :cactus: :smile_cat:

@Rishav159 thank you for detailing status of this chapter. Now I know where I might start :+1:

redblobgames commented 7 years ago

@nervgh I definitely agree that having these kinds of task lists would be useful for new contributors. It's just that there's no one to maintain those lists (**), so my worry is that the lists will get out of date. So instead we've been letting whoever's working on the chapter keep their own list. For the most part each chapter has been worked on by one person.

** Rishav and I were working on this project for summer 2017. I think Ghost--Shadow was working on it in 2016. Peter's focusing on the pseudocode and python. So there's no one actively on this project right now, and probably won't be until next summer (if it gets in GSoC). I try to check in every few days.

nervgh commented 7 years ago

@redblobgames thank you for this comment! I see that you have done great work :+1:

This project is still curious for me and I am going to continue working on it. But I am moving slowly :turtle: because I am learning English and Math in parallel :book: And I have a work of course =)

I want to be useful but I am not sure where I should moving on. For example, I have a little experience with Math Logic and Prolog language and I might take one or a couple of next chapters "7-Logical-Agents", "8-First-Order-Logic" and "9-Inference-In-First-Order-Logic". But there are chapters before those which are not still (mostly) complete. Where should I focus my efforts? What do you think?

redblobgames commented 7 years ago

@nervgh You have good points about not being able to see the status. Maybe after each chapter is 80% finished the author of that chapter can make a list of the things remaining, and then we can make them into github issues. I can work with @Rishav159 (who did all the work over the summer — I was only the mentor) to put that list into github issues. So far most of the work has been on new chapters and not completing existing chapters but it would be nice to make a list of what is needed if a chapter is nearly complete.

There are lots of visualizations possible and we don't know which ones will be useful/interesting. We don't have to go in chapter order — see issue #27; people have picked a chapter that's interesting to them and are not going in order. If you studied from AIMA, you might be able to look back to see which chapters were confusing, and might be easier to understand with interactive visualizations. If the chapter was not confusing, then the interactive visualizations may not be as useful. For some chapters there may not be any useful visualizations we can think of.

Pick any chapter you liked and think would be easier to understand with some visualizations :)

ghost commented 6 years ago

@Rishav159 @redblobgames Is anyone actively working on chapter 4? I've been looking at the code and have a few ideas on how I would tackle some of the issues.

nervgh commented 6 years ago

@regalhotpocket there are the useful issues. You can track status using those.

I guess Ch 4 is not under active development currently. You may fork at any time and improve these visualizations (via code review / MR).

ghost commented 6 years ago

@nervgh Good to know, thanks. I was actually looking at those issues, and I'll probably work on it tomorrow and post in the discussions to get feedback.

redblobgames commented 6 years ago

@regalhotpocket There isn't much active development on this project anymore. It was part of Google Summer of Code (GSoC) in 2017 and there was active development during the student application process and also during the summer, but now it's a handful of people who want to work on it unrelated to GSoC. So feel free to tackle issues :-)