Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

* How does your agent currently function? Depending on the inner workings of your agent, there may be a lot of different ways to describe

* How does your agent currently function? Depending on the inner workings of your agent, there may be a lot of different ways to describe this. For example, does it select from multiple problem-solving approaches depending on what it sees in the problem? Does it perform shape recognition or direct pixel comparison? Does it generate a candidate solution and compare it to the options, or does it take each potential answer and assess its likelihood to be the correct answer? You need not answer these specific questions, but they are examples of ways you might describe your agent's design. * How well does your agent currently perform? How many problems does it get right on the Set B problems? * What problems does your agent perform well on? What problems (if any) does it struggle on? Why do you think it performs well on some but struggles on others (if any)? * How efficient is your agent? Does it take a long time to run? (Give specific metrics) Does it slow down significantly on certain kinds of problems? If so, by how much? Why do you think your agent runs slower on certain problems? * How do you plan to improve your agent's performance on these problems before the final project submission? * How do you plan to generalize your agent's design to cover 3x3 problems in addition to the 2x2 problems? * What feedback would you hope to get from classmates about how your agent could do better? What are some of the challenges you are facing (or think you will face later) that could benefit from someone else's feedback? Use code below to answer questions above. Please answer questions below regrading theses # To activate image processing, uncomment the following imports: from PIL import Image import numpy as np import cv2 # Mock definition for RavensFigure based on the assumption of needing image file paths class Agent: def __init__(self): """ The default constructor for your Agent. Make sure to execute any processing necessary before your Agent starts solving problems here. Do not add any variables to this signature; they will not be used by main(). This init method is only called once when the Agent is instantiated while the Solve method will be called multiple times. """ pass def Solve(self, problem): # Determine if it's a 2x2 or 3x3 problem problem_type = "2x2" # Load and preprocess images images = self.load_images(problem) if problem_type == "2x2": return self.solve_2x2(images) else: return self.solve_3x3(images) def load_images(self, problem): images = {} for key, figure in problem.figures.items(): img = cv2.imread(figure.visualFilename, cv2.IMREAD_GRAYSCALE) img = cv2.threshold(img, 127, 255, cv2.THRESH_BINARY)[1] images[key] = img return images def image_difference(self, img1, img2): return np.sum(cv2.absdiff(img1, img2)) def solve_2x2(self, images): diff_AB = self.image_difference(images['A'], images['B']) diff_AC = self.image_difference(images['A'], images['C']) best_score = float('inf') best_answer = -1 for i in range(1, 7): diff_CD = self.image_difference(images['C'], images[str(i)]) diff_BD = self.image_difference(images['B'], images[str(i)]) score = abs(diff_AB - diff_CD) + abs(diff_AC - diff_BD) if score < best_score: best_score = score best_answer = i return best_answer The overview of what the code is solving The CS7637 class project is to create an AI agent that can pass a human intelligence test. You'll download a code package that contains the boilerplate necessary to run an agent you design against a set of problems inspired by theRaven's Progressive Matrices Links to an external site. test of intelligence. Within it, you'll implement the Agent.py file to take in a problem and return an answer. There are four sets of problems for your agent to answer: B, C, D, and E. Each set contains four types of problems:Basic Links to an external site. , Test,Challenge Links to an external site. , and Raven's. You'll be able to see the Basic and Challenge problems while designing your agent, and your grade will be based on your agent's answers to the Basic and Test problems. The milestones throughout the semester will carry you through tackling more and more advanced problems: for Milestone A, you'll just familiarize yourself with the submission process and data structures. For Milestone B, you'll target the first set of problems, the relatively easy 2x2 problems from Set B. For Milestone C, you'll move on to the second set of problems, the more challenging 3x3 problems from Set C. For Milestone DE, you'll look at the more difficult Set D and Set E problems, building toward the final deliverable a bit later. For all problems, your agent will be given images that represent the problem in .png format. An example of a full problem is shown below; your agent would be given separate files representing the contents of squares A, B, C, 1, 2, 3, 4, 5, and 6.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mobile Communications

Authors: Jochen Schiller

2nd edition

978-0321123817, 321123816, 978-8131724262

More Books

Students also viewed these Programming questions