Assignment 1 python networking pytorch
Assignment 1 python networking pytorch
Homework Assignments
Overview
Homework will consist of written, programming, and practical assignments. There will be
five (5) homework assignments throughout the semester, some of which will involve
significant programming. We will use Python 3 as our programming language. Homework
will be completed in groups of 2. You are expected to read the corresponding sections of
the book and be able to actively participate in class discussions.
Assignments
1. [5 points] AI Contests
Different subfields of AI (Robotics, Computer Vision, NLP, Machine Learning, etc.)
have been holding contests by defining a standard task and challenging researchers
to do their best. Some examples include the International Planning Competition,
the DARPA Urban Challenge for Robotic Cars, the Robocup Robotic Soccer League,
the TREC (Text Retrieval Conference), the PASCAL Visual Object Classes
challenge, and contests in speech recognition and machine translation. Investigate
three of these contests and briefly describe the progress made over the years. To
what extent have the contests advanced the state of the art in AI?
You can find other examples of competitions here.
The DARPA Urban Challenge for Robotic Cars was centered around developing
fully autonomous vehicles capable of navigating complex urban environments.
Early participants improved vehicle perception, navigation, and decision-making
algorithms. However, after Stanford’s “Junior” won the competition by completing
the course autonomously in just under six hours, the challenge spurred a massive
leap in autonomous driving technology, leading directly to the development of
self-driving car companies like Google’s Waymo. The DARPA Urban Challenge
drove forward real-world applications of autonomous driving, with progress seen
in commercial autonomous vehicles today.
The RoboCup Robotic Soccer League involves teams of autonomous robots playing
soccer. The long-term goal is to have a team of fully autonomous humanoid robots
defeat the human World Cup champions by 2050. Early competitions featured
robots with limited mobility, simple decision-making abilities, and basic teamwork
strategies. However, over the years, RoboCup has advanced robot coordination,
multi-agent systems, and real-time decision-making.
I think that the current focus on higher level cognitive functions is well placed and
should be prioritized in the development of Artificial Intelligence over motor skills.
In order to act and physically interface with an environment, an intelligent agent
first strategizes and logically thinks of its current state and possible actions and
then executes those actions in the environment. Any action that requires
movement uses robotics which first represents the real world and movement in
software and passes down a course of action to its hardware. The planification of
actions supersedes the actions themselves.
No, not entirely. AI can assist with specific aspects of surgery, but fully
autonomous, complex surgical operations remain beyond AI's current
capabilities. For example, robotic systems like the Da Vinci Surgical System
are used to perform minimally invasive surgeries, with the surgeon
controlling robotic arms for precision. However, issues like handling
unexpected complications, adapting to changing conditions, and making
ethical decisions require human oversight.
Yes, to some extent. AI can create art pieces, but its creativity is largely
driven by patterns and data from previous works. While AI can produce
impressive results, it lacks the emotional, cultural, and subjective nuances
that human artists bring to the creative process.
Not fully. AI can play bridge at a reasonable level, but its performance is not
yet on par with the best human players. The game’s complexity and reliance
on non-verbal communication and long-term strategic planning make it a
difficult challenge for AI.
No, not yet at a "decent" human level. While AI-powered robots can play
basic games of table tennis, they still struggle with the quick reflexes,
adaptability, and fine motor skills that human players exhibit. AI's
performance in this task is improving, but it’s not on par with decent human
players.
The thermostat is a Reflex agent as it does not have any information about the past
or future, it simply reacts to the state of an environment.
5. [5 points] AI Limits
There are specific well-known categories of problems that are extremely difficult
or undecidable for computers to solve. Does this imply that creating AI is
impossible?
The existence of undecidable or NP-hard problems does not imply that creating AI
is impossible. While certain theoretical problems cannot be solved by computers,
many real-world tasks that AI is designed to handle do not fall into those
categories. AI systems are highly effective at solving practical problems using
heuristics, approximations, and learning from data. Although achieving
human-level Artificial General Intelligence presents more fundamental challenges,
narrow AI has already proven extremely successful across many domains despite
the limits of computability.
Actuators: recommend books, add them to the shopping cart, customer help
○ Playing soccer
Actuators: kick the ball, pass the ball, defend and attack, communicate with
players
A rational agent function for the case where each movement costs one point
could be:
○ Discuss agent designs for cases where clean squares can become dirty again
and the geography of the environment is unknown.
Agent designs for cases where clean squares can become dirty again and the
geography of the environment is unknown might include the following
instructions:
● The agent should still suck when it perceives dirt on the current
square.
● Since the geography is unknown, the agent must explore the
environment systematically. This could involve methods like random
exploration or structured exploration strategies (e.g., depth-first
search, spiral movement).
● As it moves, the agent should create an internal map of the
environment. This allows it to keep track of which areas have been
cleaned and which areas remain unexplored or could have become
dirty again.
● The agent must periodically revisit squares, even after cleaning them,
since squares can become dirty again. A probabilistic model could
help the agent decide when to revisit a square based on the likelihood
of it becoming dirty.
Additionally, the agent would need an internal state to store the layout of
the environment as it discovers new squares, the cleanliness state of each square
(or the last known cleanliness state if it can’t see all squares at once), and the
frequency with which squares become dirty again, which could guide the agent's
revisiting strategy.
○ Sensor errors: The dirt sensor gives the wrong answer 25% of the time. How
does this affect your agent program?
The agents should keep a history of states to compare current sensor data
with as a security measure.
○ Pets in the house: At each time step, each clean square has a 15% chance of
becoming dirty. Can you design a rational agent for this scenario?
Since squares can re-dirty due to pets, the agent should periodically recheck
squares that were recently cleaned.
CODE:
def miles_to_kilometers(miles):
def main():
while True:
try:
break
kilometers = miles_to_kilometers(miles)
except ValueError:
main()
>>> a = ReflexVacuumAgent()
○ Take a snapshot of this. What does the output mean? [10 points]
When the agent perceives a clean location, it moves to the other location (left or right).
When the agent perceives a dirty location, it chooses to clean it by performing the 'Suck'
action. If the location remains dirty, the agent continues to suck.
>>>e = TrivialVacuumEnvironment()
>>>e.status
>>>e.add_thing(ModelBasedVacuumAgent())
>>>e.run(5)
>>>e.status
The code sets up a trivial environment where both locations are initialized to clean.
The code adds a model-based vacuum agent and runs the environment for 5 steps.
The output of e.status before and after running shows that the environment remains
clean.