0% found this document useful (0 votes)
21 views50 pages

Lecture 1 - Introduction to CS2109S and AI

CS2109S is an introductory course on AI and Machine Learning, emphasizing the importance of AI/ML for computer science majors. The course covers various topics including intelligent agents, search algorithms, and machine learning models, with assessments including a midterm and final exam. Participants are warned against plagiarism and are provided with guidelines for academic integrity.

Uploaded by

Runjia Chen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views50 pages

Lecture 1 - Introduction to CS2109S and AI

CS2109S is an introductory course on AI and Machine Learning, emphasizing the importance of AI/ML for computer science majors. The course covers various topics including intelligent agents, search algorithms, and machine learning models, with assessments including a midterm and final exam. Participants are warned against plagiarism and are provided with guidelines for academic integrity.

Uploaded by

Runjia Chen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 50

CS2109S: Introduction to AI and Machine Learning

Lecture 1:
Intro to CS2109S and AI
16 January 2024

1
Intro to CS2109S

2
Instructors

Muhammad Rizki Maulana Conghui Hu


rizki@nus.edu.sg conghui@nus.edu.sg

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

All course participants (including permitted guest students) who have


access to the course materials on Canvas or any approved platforms by
NUS for delivery of NUS modules are not allowed to re-distribute the
contents in any forms to third parties without the explicit consent from
the module instructors or authorized NUS officials

5
Motivations behind CS2109S
• AI/Machine learning is a big deal

• Exposure to AI/ML for CS majors is deemed important by the school

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

Week 1 Week 4 Week 7 Week 13

“Classical” AI Machine Learning

Search Algorithms ML Models & Techniques Miscellaneous


• Uninformed search: BFS, DFS • Decision Trees • Unsupervised
• Local Search: Hill Climbing • Linear/Logistic Regression Learning
• AI & Ethics
• Informed search: A* • Support Vector Machines
• Adversarial search: Minimax • Neural Networks
Applied CS2040S, CS1231 Applied Linear Algebra, Calculus, Statistics & Probabilities
Python Numpy, Scikit-learn, PyTorch

“hands-on” problem sets 10


Textbook
Russell and Norvig (2021)
Artificial Intelligence:
A Modern Approach (4th Ed)

a.k.a. AIMA

There is no need to buy this book.

11
Learning Management System

Only for Gradebook to record marks


for checking and webcast
12
All cases no matter how small
Plagiarism Policy will be handed over to BoD

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

Plagiarism checker will be performed against all previous batches!


13
Case Studies of Plagiarisms
• Created a base source code and derived solutions from the same base
• Caught and cases submitted to BOD
• Fully/partially copy-pasted friend’s solutions (current/past student) and
tried to be smart by doing some nontrivial modifications
• Caught and cases submitted to BOD
• Fully/partially copy-pasted friend’s solutions (current/past student) and
claimed that solutions were from ChatGPT or ported from publicly
available source codes
• Caught and cases submitted to BOD

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%

30% 50% 65%

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

• Enough EXP? Level Up!


• Your final level is your CA grade

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%

If you need extension (for valid reasons), please ask early

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?

Credit: IEEE Spectrum Credit: Guardian Credit: NYTimes


23
What is AI?

Credit: Tesla Credit: Eden AI Credit: Microsoft

24
What is AI? Let’s ask AI

25
What is AI? Week 1
Write it as a poem*

Week 2-4

This poem succinctly summarizes this course. Week 5-11

Week 12

Week 13

*) This is not the actual (full) prompt


26
Outline
• What is AI?
• A Brief History of AI
• Intelligent Agents
• The Structure of Agents

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

“What is AI?” Function “AI is …”


F
u
n
Function
c Bb6 (chess move)
t
Credit: Chess.com
i
o
“Pikachu in the Eiffel tower” Function
n

How do we write this Function? 30


Intelligent Agents: 1st Attempt
Real-world problems are usually not that simple

It usually requires a feedback loop between the AI and the world 31


Intelligent Agents
The agent function maps
Agent from percept histories to
percepts actions:
Sensors

Function Environment [f: P* → A]

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?

The agent function maps


Agent from percept histories to
percepts actions:
Sensors

Function Environment [f: P* → A]

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?

A rational agent will choose actions


PEAS that maximize performance measure.
Performance Measure, Environment, Actuators, Sensors 34
Intelligent Agents: Autonomous Driving
Sensors
• Camera Agent
• LIDAR percepts Performance Measure
Sensors
• Speedometer • Safety
• … • Speed
Function Environment
• Legal
Actuators
actions • Comfort
• Steering wheel Actuators
• …
• Accelerator Environment
• Brake Roads, weather,
vehicles, obstacles
• … PEAS
Performance Measure, Environment, Actuators, Sensors 35
Intelligent Agents: AI Assistant/Chatbot
Sensors
• Text input Agent
• Chat history percepts Performance Measure
Sensors
• Context • Correctness
• … • Conciseness
Function Environment
• Legal
Actuators
actions • Safety
• Text output Actuators
• …
• Image output Environment
• API Chat interface, third-
party plugins, user
• … PEAS
Performance Measure, Environment, Actuators, Sensors 36
Properties of Task Environment
Full

Fully observable (vs. partially observable)


Partial An agent's sensors give it access to the complete
state of the environment at each point in time.

Deterministic (vs. stochastic)


Strategic The next state of the environment is completely
determined by the current state and the action
executed by the agent. (If the environment is
Credit: Google Play

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

if the environment itself does not change with


the passage of time, but the agent's
performance score does)
38
Episodic
Properties of Task Environment
Discrete

Continuous
Discrete (vs. continuous)
A limited number of distinct, clearly defined
percepts and actions.
Multi-agent

Single agent (vs. multi-agent)


Multi-agent
An agent operating by itself in an environment.
Credit: Keyence

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.

Common agent structures


• Simple reflex agents Function

• Model-based reflex agents


• Goal-based agents
• Utility-based agents
• Learning agents

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

Can be reflex, model-based, goal-based, and utility-based

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

Credit: Indomie Credit: Amazon 47


Summary
• AI: computers trying to behave like humans
• PEAS Framework:
• Performance measure: define “goodness” of a solution
• Environment: define what the agent can and cannot do
• Actuators: outputs
• Sensors: inputs
• Agent function is sufficient to define an AI agent
• Common agent structures:
• Reflex, model-based, goal-based, utility-based, learning
• Exploration vs exploitation
48
Coming Up Next Week
• Formulating search problems
• Uninformed search algorithms
• Breadth-first search
• Depth-first search
• Uniform-cost search
• How to handle repeated states?
• Memoization / graph search
• How to handle infinite depth in search?
• Depth-limited search
• Iterative deepening search
• Forward, Backward, Bidirectional search

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

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy