This course explores the concepts and algorithms at the foundation of modern artificial intelligence, diving into the ideas that give rise to technologies like game-playing engines, handwriting recognition, and machine translation. Through hands-on projects, students gain exposure to the theory behind graph search algorithms, classification, optimization, machine learning, large language models, and other topics in artificial intelligence as they incorporate them into their own Python programs. By course’s end, students emerge with experience in libraries for machine learning as well as knowledge of artificial intelligence principles that enable them to design intelligent systems of their own.
Prerequisites
CS50x or at least one year of experience with Python.
Watch an introduction
Even if you are not a student at Harvard, you are welcome to “take” this course for free via this OpenCourseWare by working your way through the course’s seven weeks of material. If you’d like to submit the course’s seven projects for feedback, be sure to create an edX account, if you haven’t already. Ask questions along the way via any of the course’s communities!
- If interested in a verified certificate from edX, enroll at cs50.edx.org/ai instead.
- If interested in a professional certificate from edX, enroll at cs50.edx.org/programs/ai instead.
- If interested in transfer credit and accreditation from Harvard Extension School, register at web.dce.harvard.edu/extension/csci/e/80 instead.
- If interested in transfer credit and accreditation from Harvard Summer School, register at web.dce.harvard.edu/summer/csci/s/80 instead.
If you are a teacher, you are welcome to adopt or adapt these materials for your own course, per the license.
- source url:
reference
- [ 机器人路径规划算法(十一)A-star算法 ] (https://mronne.github.io/2020/04/03/%E6%9C%BA%E5%99%A8%E4%BA%BA%E8%B7%AF%E5%BE%84%E8%A7%84%E5%88%92%E7%AE%97%E6%B3%95-%E5%8D%81%E4%B8%80-A-star-%E7%AE%97%E6%B3%95.html)
- source url
- https://cs50.harvard.edu/ai/2024/projects/1/knights/
- mark: 这个project主要是训练用 Proposition 表达 knowledge base 的能力 ? 最后一个puzzle比较难,虽然过了case。。感觉还是不是很理解
- https://cs50.harvard.edu/ai/2024/projects/1/minesweeper/
- https://cs50.harvard.edu/ai/2024/projects/1/knights/
-
source url
-
core conception
-
Some rule ( math tool )
-
conditional Probability
-
Joint Probability
-
Bayesian rule
-
Probability rule
- negative
- Marginalization
- ...
-
Bayesion Network
- an efficient way to represent any full joint probability distribution by exploiting conditional independence
- Inference
- exact Inference:
- use math rule, enumeration, variable elimination
- approximate inference:
- sampling methods
- exact Inference:
-
Probabilistic reasoning over time
- (hidden) Markov model , Markov chains
- sensor model , transition model
-
-
-
complementary reference
-
source url
-
Core conception
- Local search
- Hill climbing
- Simulated Annealing
- Hill climbing
- Linear Programming
- Constraint Satisfaction
- terms of constraint
- unary constraint
- Node Consistency
- binary constraint
- Arc Consistency
- Hard / soft constraint
- unary constraint
- revise algorithm
- arc3 algorithm
- backtrack search algorithm
- terms of constraint
- Local search
-
source url
- https://cs50.harvard.edu/ai/2024/projects/4/shopping/ ( about k-nearest-neighbour )
- https://cs50.harvard.edu/ai/2024/projects/4/nim/ (about Q-learning)
-
Core conception
- Supervised learning
- learn a function to map input to output
- relative task
- classification
- nearest-neighbour classification
- k-nearest-neighbour classification
- perceptron learning rule
- define , weight vector / input vector
- W dot product X -> Output
- update a formulation
- update each weight given data point, (x , y)
- ie. wi = wi + α(actual_value - estimate) * xi
- α is learning rate , a number which we choose
- ie. wi = wi + α(actual_value - estimate) * xi
- update each weight given data point, (x , y)
- end up with a threshold function
- define , weight vector / input vector
- Support Vector Machines
- effect: maximum margin separator
- boundary that maximizes the distance between any of the data points
- can represent decision boundaries with more than two dimensions
- effect: maximum margin separator
- regression
- learning a function mapping an input point to a continuous value
- classification
- Evaluating Hypotheses
- loss function : expresses how poorly our hypothesis performs
- 0-1 loss function
- L1 loss function
- L2 loss function
- overfitting : a model that fits too closely to particular data set
- define cost function, cost(h) = loss(h) + complexity(h)
- avoid overfitting:
- regularization : penalizing hypothesis that are more complex to favor simpler, more general Hypotheses
- holdout cross-validation
- splitting data into a training set and test set
- loss function : expresses how poorly our hypothesis performs
- Reinforcement learning
- define: given a set of rewards or punishments, learn what actions to take the future.
- Markov Decision Process
- Set of states S
- Set of actions Actions(s)
- Transition model P(s'|s,a)
- Reward function R(s, a,'s)
- Q-learning
- Greedy Decision-Making
- Explore vs. Exploit
- ε-Greedy
- Unsupervised learning
- given input data without any addtonal feedback , learn patterns
- relative task
- Clustering
- k-means clustering
- Clustering
- Supervised learning
-
source url
- https://cs50.harvard.edu/ai/2024/projects/5/traffic/
- 这个project 比较简单,更多的只是让你体会怎么用tensorflow 来构建一个 CNN 分类网络
- https://cs50.harvard.edu/ai/2024/projects/5/traffic/
-
Core conception
- Artificial Neural Networks
- Model mathematical function from inputs to outputs based on the structure and parameters of the network
- Allows for learning the network's based on data
- ie. h(x1, x2) = w0 + w1.x1 + w2.x2
- activation function -if g is a activation function , then h(x1, x2) = g(w0 + w1.x1 + w2.x2) [ it is a network that have two inputs , one output ]
- Gradient descent
- updates weight, minimize the amount of loss
- Mini-Batch Grandient descent
- Perceptron
- Only capable of learning linearly separable decision boundary
- Multilayer neural network
- back-propagation ( algorithm for train Multilayer network )
- dropput ( temporay remove some units prevent overfitting )
- Image convolution
- max-pooling
- artificial intelligence framework
- recurrent neural network
- Artificial Neural Networks
-
Quiz (./neural_networks/quiz_5.md)
-
source url
-
Core conception
- language general
- Syntax of language
- sentiment
- bag-word-model
- Markov chain, BayesBaseClassfier
- smoothing
- word representation
- convert: a word -> a vector
- a word -> distribution representation of vector
- word2vec model
- learn corpus, word -> a sequence of probability distribution
- calc distance(words["book"], words["food"])
- liken Translation problem
- Input is not fixed -> use RNN (outmoded)
- Translate a sequence tp another sequence
- input -> encoder -> decoder -> output
- Attention
- give words attention scores
- Transformers
- input parallelize
- self-Attention
- bag-word-model
- language general