Lecture 1 - Introduction to CS2109S and AI
Lecture 1 - Introduction to CS2109S and AI
Lecture 1:
Intro to CS2109S and AI
16 January 2024
1
Intro to CS2109S
2
Instructors
3
Teaching Assistants
Chowdhury Rafeed Maximilliano Utomo
Chew Kin Whye Sun Yu Pei Tai Tze Kin Udit Sanghi
Rahman Quok
Muhammad Ayaz
Mengqi Guo Li Po Hsien Tan Chee Xiang Liu Diwen Tanveer Singh
Dzulfikar
Han Liang Wee Eric Ce Hao Lee Kai Kiat, Ivan Chan Wei Hao Quek Jia Zhi, Shaun Eliot Lee Leong Wern
Anxing Xiao Chen Hung-yu Ng Qi Ting Lee Chun Jie Ryan Reno Lim Chen Hanlin
Chen Yu Florentiana Yuwono Wilson Widyadhana Jason Christopher Gan Pang Yen Tan Ping Zhi
Ramanathan
Wang Yunsong Liao Yu-chuan Sun Ruiheng James Shen Wang Cheng
Kumarappan
4
Rights Infringements on NUS Course Materials
5
Motivations behind CS2109S
• AI/Machine learning is a big deal
CS3243: AI CS3263: AI
CS2109S
CS3244: ML CS3264: ML
6
Pre-survey Results
Some worries about:
• None (most popular)
• Math
• Pre-requisites (more on this) + practice problems
• Heavy Workload
• Follows CS2040
• Common mistakes (more on this)
• Difficulty
• Not meant to be hard. Still adjusting the difficulty…
• Final Exam
• We are trying to improve this
7
Course Pre-requisites
• CS1101S, CS1010S or equivalent
• CS1231 or equivalent
• Trees, graphs, counting & combinatorics
• MA1521
• Differentiation, chain rule
• CS2040S or equivalent
• Tree and graph search
• Linear algebra
• Vector, matrix, and their operations Problem Set 0
• Python
8
Common Mistakes
• Debugging algorithms with Jupyter Notebook
• Should use IDE for PS0 and all other non-ML problem sets
• Not reading documentations and reinventing the wheels
• There are many helpful functions built-in
• Coding directly on Coursemology
• Should code and test locally
9
Midterm Final Assessment
Overview (During lecture time)
Subject to successfully securing the venue
(2 days contest)
Weekend after the reading week
a.k.a. AIMA
11
Learning Management System
Dos
• Discussions without sharing/consulting/taking away any code
• Use ChatGPT with proof (e.g., share links)
Don’ts
• Use codes from those who has done or currently doing the course
• Use codes from the internet without proper citations
• Publish codes to any publicly accessible sites (e.g., GitHub, Google
Drive) or send your codes to anyone
There were many more cases, but basically, we dealt with them appropriately
14
Grading
Name Percentage
Coursemology (CA) 30%
(expected: full marks)
Midterm 35%
Final Assessment 35%
FREE
F F C? 15
Gamified CA (30%)
Background
Survey
+50 EXP early bonus! +100 EXP
+100 EXP +500 EXP
Lecture Training Tutorial Problem Set
(every ~2 weeks)
Forum EXP ~1300 EXP
+100 EXP
16
Attendance vs Performance
17
Assessments
• Midterm (35%)
• Closed book, open-sheet (as good as open book)
• Focus on application, not memorization
• Date/Time: Tuesday, 5 March (Week 7), 4:00 PM
• Venue: TBA
• Final (35%)
• ~2 days take-home assessment
• Focus on practical machine learning
• Date/Time: Saturday, 27 April, 8:00 PM - Sunday, 28 April, 11:59 PM
18
Late Policy
• Up to 1 hour, 0%
• Up to 24 hours, -20%
• Up to 3 days, -30%
• Beyond 3 days, -50%
19
Intro to Artificial Intelligence
20
Outline
• What is AI?
• A Brief History of AI
• Intelligent Agents
• The Structure of Agents
21
Outline
• What is AI?
• A Brief History of AI
• Intelligent Agents
• The Structure of Agents
22
What is AI?
24
What is AI? Let’s ask AI
25
What is AI? Week 1
Write it as a poem*
Week 2-4
Week 12
Week 13
27
• Before 1900
A Brief History of AI • Early 1900
• Atanasoff-Berry Computer: solve linear equations
• Neural networks
• 1950s-1960s
• Alan Turing: Turing machines, Turing test
• Checkers AI, Lisp programming language, ELIZA
• 1970s
• 1st AI Winter
• 1980s
• Expert Systems, Fifth Generation Computers
• 1990s
• Deep Blue
• 2000-2010
• 2nd AI Winter, Big data
• 2011-Beyond
• Deep neural networks, Watson, AlphaGo, ChatGPT
28
Outline
• What is AI?
• A Brief History of AI
• Intelligent Agents
• The Structure of Agents
29
• Handcraft → “Classical” AI
Intelligent Agents: 1st Attempt • Learn → Machine Learning
Function 5
actions
Actuators The agent program runs on the
physical architecture to
produce function f
32
Intelligent Agents How would agent know to do the right thing?
actions
Actuators The agent program runs on the
physical architecture to
produce function f
33
Intelligent Agents How would agent know to do the right thing?
Performance Measure
Agent Things to consider:
percepts
Sensors • Best for whom?
• What are we optimizing?
Function Environment • What information is available?
• Any unintended effects?
actions
Actuators • What are the costs?
Stochastic/Strategic
deterministic except for the actions of other
agents, then the environment is strategic)
37
Deterministic
Properties of Task Environment
Sequential
Episodic (vs. sequential)
The agent's experience is divided into atomic
Sequential
"episodes" (each episode consists of the agent
perceiving and then performing a single action),
and the choice of action in each episode
depends only on the episode itself.
Static/Semi-Dynamic
Static (vs. dynamic)
The environment is unchanged while an agent is
Dynamic deliberating. (The environment is semi-dynamic
Credit: Keyence
Continuous
Discrete (vs. continuous)
A limited number of distinct, clearly defined
percepts and actions.
Multi-agent
39
Single-agent
Outline
• What is AI?
• A Brief History of AI
• Intelligent Agents
• The Structure of Agents
40
The Structure of Agents
An agent is completely specified by
the agent function mapping percept
sequences to actions.
41
Simple Reflex Agent
Condition-action rule
If left empty: left
If right empty: right
If up empty: up
If down empty: down
42
Model-based Agent
Condition-action rule
If not die, pick the action
43
Goal-based Agent
44
Utility-based Agent
0 +1 -1 0
X
-1 0 +1 0
45
Learning Agent
46
Exploitation vs Exploration
An agent operating in the real world must often choose between:
• Maximizing its expected utility according to its current knowledge
about the world (Exploit)
• Trying to learn more about the world (Explore)
vs
49
To Do
• Lecture Training 1
• +100 Free EXP
• +50 Early bird bonus
• Problem Set 0
• Due 27 January
• Practice Problems: Python and Numpy (optional)
50