1 / 12

CS 601 Final Project

CS 601 Final Project. Spencer White Kristine Perry. Objectives:. Experiment with a genetic algorithm to see if it can find a better solution than the random walk algorithm to the “Time flies like an arrow” generation problem.

molimo
Download Presentation

CS 601 Final Project

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS 601 Final Project Spencer White Kristine Perry

  2. Objectives: • Experiment with a genetic algorithm to see if it can find a better solution than the random walk algorithm to the “Time flies like an arrow” generation problem. • Cache the costs of already computed constraints to increase runtime performance

  3. Cache Already Computed Costs: • Modified “build_nodefeat_query” because it provided numerical values to use in the hash function • Check to see if the desired query is already in the database. • If so, then look up the cost of the desired query in the hash table. • If not, create a character string representation of the query and call “my_grepper_count.” Store the result in the hash table and return. • Each constraint processing function now calls “build_nodefeat_query” instead of “my_grepper_count”

  4. Results: • Time spent evaluating the cost of one sentence without caching: 44.3 seconds • Time spent running the rest of the iterations of the algorithm with caching: 12.2 seconds

  5. Genetic Algorithms • Create a grammar • Generate an initial population of genotypes • Evaluate the fitness function on every new phenotype • Sort the population of genotypes by their merit • Create a certain number of children based on the fitness of the parents • Fill up the rest of the population from the previous generation selected based on their fitness. • Repeat from step 3 until a solution is found.

  6. Hygiene Showers daily Showers weekly Takes a yearly bath (whether he needs it or not) Arrival Time Shows up early Shows up on time Shows up half an hour late Fails to show up at all because he was too busy working on a CS 470 project Behavior Brings flowers Opens doors Recites Shakespeare Laughs like Erkle Proposes on the first date Appearance Looks like Viggo Mortensen Looks like Orlando Bloom Looks like Gollum Charm Roguish smile of Harrison Ford Rasping breath of Darth Vader Quirky mannerisms of Yoda Conversation Talks about General Conference Talks about CS 470 Talks about his mission Discusses current politics Goes on for hours about his pet rock Doesn’t say anything the entire evening Dating Example

  7. Dating Example Generate an initial population of genotypes: Parent: 1 3 1 2 2 5 Showers daily Shows up half an hour late Brings flowers Looks like Orlando Bloom Rasping breath of Darth Vader Goes on for hours about his pet rock Parent: 3 1 5 3 1 2 Takes a yearly bath Shows up early Proposes on the first day Looks like Gollum Roguish smile of Harrison Ford Talks about CS 470

  8. Dating Example Evaluate the fitness function on every new phenotype Parent: 1 3 1 2 2 5 Showers daily Shows up half an hour late Brings flowers Looks like Orlando Bloom Rasping breath of Darth Vader Goes on for hours about his pet rock Parent: 3 1 5 3 1 2 Takes a yearly bath Shows up early Proposes on the first day Looks like Gollum Roguish smile of Harrison Ford Talks about CS 470 Child: 1 3 1 2 | 1 2 Showers daily Shows up half an hour late Brings flowers Looks like Orlando Bloom Roguish Smile of Harrison Ford Talks about CS 470 Consult the Database: Shall we keep this child?

  9. Dating Example Evaluate the fitness function on every new phenotype Parent: 1 3 1 1 2 5 Showers daily Shows up half an hour late Brings flowers Looks like Orlando Bloom Rasping breath of Darth Vader Goes on for hours about his pet rock Parent: 3 1 5 3 1 2 Takes a yearly bath Shows up early Proposes on the first day Looks like Gollum Roguish smile of Harrison Ford Talks about CS 470 Child: 3 1 5 3 | 2 5 Takes a yearly bath Shows up early Proposes on the first date Looks like Gollum Rasping breath of Darth Vader Goes on for hours about his pet rock Consult the Database: Shall we keep this child?

  10. Results of Random Walk Running with 10 tries 20 flips Output: “{time an} {flies .} like arrow" Run Time: 8 minutes 48.31 seconds

  11. Results of Genetic Algorithm Output: “Like an arrow flies time” Run Time: 56.5 seconds

  12. Questions? Time spent getting random walk lab to recompile: 1 hour 30 minutes Time spent porting code to C++: 1 hour Amount of memory used on Dr. Geary’s machine due to core dumps: 2 gigabytes Time spent coding up a hash table: 2 hours Time spent chatting with other TA’s while pretending to code this project in the TA cubicles: 3 hours Time spent modifying code to cache queries: 1 hour Time spent debugging segmentation faults: Does anyone really want to know? Time spent surfing the web for pictures for this presentation: 2 hours Number of hits google produces when searching the image database for “timeflies”: 429 Special thanks to David Hubbard for C to C++ translation expertise Number of zombie processes still running on Dr. Geary’s machine: Can anyone say “night of the living dead”? Number of logins to Dr. Geary’s machine for this project: approximately 30 Random facts from database queries

More Related