【速成課:人工智能】Ai - [21集全/中英雙語(yǔ)] - Artificial

# 1. What is AI?
- AI definition: A machine is said to have artificial intelligence if it can interpret data, potentially learn from the data, and use that knowledge to adapt and achieve specific goals.
- Dartmouth Conference
- AI winter until about 2010. -enough computing power→ AI revolution
# 2. Supervised Learning:
- 3 main types of learning: Reinforcement, Unsupervised, Supervised.
- Reinforcement Learning: The process of learning is an environment through feedback from an AI's behavior.
- Unsupervised Learning: The process of learning without training labels. (clustering or grouping)
- Supervised Learning: The process of learning with training labels. (supervisor)
- 1958 psychologist Frank Rosenblatt, PERCEPTRON, "triangles" or "not-triangles".


- Random weights create a random decision boundary.
- Update rule (0 / positive or negative) → weight (same / change).

- PRECISION & RECALL: Precision tells us how much you should trust your program when it says it's found something. Recall tells you how much your program can find of the thing you're looking for.

- CRITERIA
# 3. Neural Networks and Deep Learning:
- ImageNet (Li Feifei): 3.2 million labeled images, sorted into 5247 nested categories of nouns. → Crowd-Sourcing
- AlexNet (Alex Krizhesky): hidden layers, faster computation hardware → more than 60 million neurons needed

# 4. Training Neural Networks:
- 2 main parts of neural networks: architecture (neurons and their connections) & weights.
- Optimization
- Linear Regression: adjust → ERROR as small as possible → Line of Best Fit
- Loss Function
- Backpropagation of the Error: find the best combination of weights to get the lowest error
- Global / Local Optimal Solution → Learning Rate (Step Size)
- Fitting to the Training Data / Overfitting (avoid by keeping it simple)
- Consider: How to best represent our various problems as features in AI systems? What mistakes these programs might make?
# 5. How to make an AI read your handwriting (LAB):
- Google Colaboratory, Python
- Segmentation Problem
URL: https://colab.research.google.com/drive/1NyYH1EPpaJlMBLK0fcKYz4icaD1SNSLK

- Training Set & Testing Set
- EMNIST: Extended Modified National Institute of Standards and Technology
- Images (train & test): 28x28 pixels, grayscale (0-255) / 255 = 0-1 PREPROCESSING
- Data collecting is a very important step to training a good neural network.

- Multi-Layer Perception Neural Network
- Python Libraries SKLearn (Sci Kit Learn)

- Input-, hidden and output-layer
- iteration = epoch
- update weights and biases

- Error of the Loss Function (Expectation: loss going down)
- Confusion matrix


- EMNIST paper URL: https://arxiv.org/abs/1702.05373v1
# 6. Unsupervised Learning:
- Supervised Learning: In SL, we're trying to build a model to predict an answer or label provided by a teacher.
- Unsupervised Learning: In USL, instead of a teacher, the world around us is basically providing training labels.
- Unsupervised Clustering
- K Clusters
- K-Means Clustering


- 2 steps: predict & learn
- What observations can we measure?
- How do we want to represent the world?
- Representation Learning


- Yann LeCun
# 7. Natural Language Processing:
- Natural Language Understanding
- Natural Language Generation
- Morphology (swim, swimmer, swimming, drinking, drinker ...)
- Distributional Semantics
- John Firth
- A Count Vector is the number of times a word appears in the same article or sentence as other common words. If two words show up in the same sentence, they probably have pretty similar meanings. (car, cat, felidae)
- Encoder-Decoder-Model
- Ray Mooney

- Recurrent Neural Network: RNNs have a loop in them that lets them reuse a single hidden layer, which gets updated as the model reads one word at a time.

- Vector


- Visualization of word representations

# 8. Make an AI sound like a YouTuber (LAB):
URL: https://colab.research.google.com/drive/1DjtWqJjuy4mBvOkLqMPIfqjiIINpftJq?usp=sharing
- Natural Language Processing
- 4 steps to build a NLP AI:
- Gather and clean the data. (preprocessing: tokenization, stemming)


Cut out rare words ← can't recognize any patterns related to them (showed only once)

Clean endings, punctuations and numbers.

Replace rare lexical types with an?unk
, indicating they are unknown.

- Set up the model. (sentences → lists of numbers. Batches. Embedding Matrix & RNN)


If two words are used in similar ways, then the numbers in their vectors should be similar.

- Train the model. (Perplexities)

- Make predictions.

Best score /= wanted sentences → Basic sampler: Knowing which branches to take is a key part of solving other problems with AI.
- AI models are missing the understanding we have as humans. (tokenization, an embedding matrix, a simple language model to predict the next word)
# 9. Reinforcement Learning:
- Reward (positive, negative)
- States → actions → training label
- Credit Assignment
- Agent, environment, actions, state

- Trade-off between exploitation and exploration

- Value Function
- Discrete symbols
# 10. Symbolic AI:
- 1959: Allen Newell, Herbert Simon, Cliff Shaw → General Problem Solver (content & technique)
- Symbols: to represent real-world objects in a computer program → Symbolic AI (symbols + logic → solutions)
- Logic is our problem-solving technique, and symbols are how we're going to represent the problem in a computer.
- A relation can be an adjective that describes a symbol, and we write it in front of the symbol that's in parentheses. Relations can also be verbs that describe how symbols interact with other symbols.
EAT(Jabril, Donut) WEARS(John-Green-Bot, Polio)
- Symbols & Relations: think of symbols as nouns and relations as adjective or verbs that describe how symbols play nicely together.
- Knowledge Base

- Propositions (True / False) → Truth Table (Proposition logic = Boolean logic)

- AND, OR, NOT
- Implication (If / then statements)
- Inference: the process of coming up with new propositions and checking whether they fit with the logic of a knowledge base.

- Expert Systems:
Expert systems make conclusions based on logic and reason, not just trial-and-guesses like a neural network.
An expert system can explain its decisions by showing which parts were evaluated as true or false.
A human expert can easily define and redefine the propositional logic in an expert system.
# 11: Robotics:
- 3 core problems in robotics: Localization, Planning and Manipulation
- Stereoscopic Vision
- Simultaneous Localization and Mapping (SLAM)
- Infrared Depth Cameras (motion sensors)
- LiDAR
- Planning is when an AI strings together a sequence of events to achieve some goal. Define actions ? preconditions (How objects currently exist in the world)
Action: open door; Precondition: door is closed; Effect: door will be open.
- Manipulation: Proprioception, Closed Loop Control
- Proprioception is how we know where our body is and how it's moving, even if we can't see our limbs.
# 12. AI Playing Games:
URL: https://colab.research.google.com/drive/1uYXTDeBbPeuJfM1teufZ9nUaiRIN9nHW#scrollTo=cfEC_kV7eCdI
- AI in Games: Games provide constrained scenarios for testing new AI algorithms and approaches. In a game, it's easy to know whether the AI is winning or losing (score or some objective measure of "winning"). Learn → try out → improve. Games provide their own training data. (AI needs lots of training data to get really good.) AI play against itself to generate TD and evolve better game strategies, or be programmed to look at previous games. How an AI is improving over time? A sense of the difficulty of problems an AI can solve.
- 1770 Wolfgang von Kempelen (controlled by a person hidden inside)

- Late 1940s - early 1950s AI experts: simpler chess situations; checkers
- 1957 USA and CCCP: programs that could play a full chess game
- Checkers: 1995 Chinook
- Chess: 1997 Deep Blue
- Go: 2017 AlphaGo
- DOTA: 2018
- Starcraft: 2019 DeepMind




- Computational challenges → Algorithm: Monte Carlo Tree Search


- Evolutionary neural networks use the environment as an input, like reinforcement learning. (This approach introduces multiple agents who try multiple neural network structures, and then build on successful ones for the next generation.)
# 13. Let's make an AI that destroys video games (LAB):
- Games involve: strategy, planning, coordination, deception, reflexes, intuition.
- Step 1: Build game
- Step 2: Create AI -> NN


- Reinforcement Learning Strategies

- Genetic algorithms

- 100 mutated and 100 original models (in case the mutations were harmful)
- Step 3: Train model

- When problems bigger (like industrial-sized problems), the random mutations of genetic algorithms are sometimes too random to create consistently good results.
- Try to change: the values of the fitness function, how the NN gets mutated (structure instead of weights), how much the run function loops per second.

# 14. Humans and AI working together:

- Computer (for the early game) looks several moves ahead and estimates the most promising next moves. Human (when more complicated) choose among uncertain possibilities based on experience, and even what they know about the opponent.
- 2007 the 1st centaur chess tournament. Winning team: Anson Williams, Chen Yingheng, Nelson Hernandez, Intagrand


- AI: parts requires memorization, rote response and following rules. Humans: aspects that require nuance, social understanding and intuition.
AI -> Human:
- AI could help humans make decisions when they're dealing with large amounts of complicated information.
- AI could help when humans are trying to come up with new inventions or designs, like a new engineered structure.
- AI could also support and scale-up interactions between people. It could save people from doing rote mental tasks, so that they have more time and energy to help.
- Robots that are AI-enabled but guided by humans could give people more strength, endurance or precision to do certain kinds of work.
Human -> AI:
- Humans can provide AI with meaning and labels, because we have so much more experience with living in the real world. (WIKIPEDIA)
- Humans can also try and explain an AI system's predictions, outputs, and even possible mistakes to other humans, who aren't as familiar with AI.
- Human experts can also inspect algorithms for fairness to different kinds of people, rather than producing biased results. Bias is a very complicated topic, so we'll dive deeper into the nuances in an upcoming episode and lab.
- AI doesn't understand things like the potential consequences of its mistakes or the moral implications of its decisions. That's beyongd the scope of its programming.
Think about:
- What data humans are providing to algorithms?
- How our human jobs could be made easier by working with AI?
# 15. How YouTube knows what you should watch:
- Recommender Systems (Supervised & Unsupervised Learning)
- 3 common approaches: Content-based, Social and Personalized Recommendations
- Collaborative Filtering

(1: watched and subscribed; 0: watched but not subscribed; empty: haven't seen.)
- Rating system: 0 or 1, one-to-five star, the number of milliseconds a user dwells on a post. (Basic strategy: use known information from users to predict preferences)
Three key problems make mistakes:
- Datasets that recommender system Als get are usually very sparse. Most people don't watch most shows or videos - there just isn't enough time! And even fewer people give social ratings such as "likes".
- There's the cold start problem. When we go on a website for the first time, for example, the AI doesn't know enough about us to provide good personalized recommendations.
- Even if AI makes statistically likely predictions, that doesn't mean those recommendations are actually useful to us. (Interested but also feasible without RS. RS don't understand important social context. On social media, RS can trap us in ideological echo chambers -> skew our knorledge about the world)
- Incognito browsers (prevents sites from connecting data)
- How to build RS: Think explicitly about the trade-offs that are involved. Decide how to define the clusters of users or items, can create more or less personalized spaces.
# 16. Let's make a movie recommendation system (LAB):
URL: https://colab.research.google.com/drive/1-v9cw18wTDjaCUlECKHsQnHeisLKyG8U
- Step 1: Get global rating data
- Step 2: Create generic recommendations
- Step 3: Get personalized ratings
- Step 4: Implement collaborative filtering:
Item-Item Collaborative Filtering, Latent Factor Analysis, User-User Collaborative Filtering
- User-User Collaborative Filtering:

Rating of two movies
Minimum / Maximum Neignborhood Size (cluster)


A small neighborhood size would mean the AI considers fewer people who have more similar movie tastes, and it has less data to make predictions.
- Step 5: Combine Recommendations Lists

Combined dataset of ratings -> User-User Collaborative Filtering Model
# 17. Web Search:
- Search Engines: Gather data, create organized systems, find results.
- Internet /= Web: The Internet is a collection of computers that send messages to each other (e.g. video services). The Web is part of the Internet and uses the Internet's connections to send documents and other content in a format that can be displayed by a browser like Chrome.
- Step 1: collect data -> Web Crawler

- Step 2: Index & Inverted Index (For each word, it lists all the web pages that contain that word. The web pages are usually represented by ID instead of a long lists of URLs.)


- Step 3: rank web pages so that the top result is more likely to be relevant than the 10th result. (Rugular users do training instead of hired supervisors: bounce -> bad result / click and stay for a while reading -> good result)
- Actual answers wanted -> Knowledge Bases (symbolic AI)
Main problems with KB: hard to write down all of the facts in the universe, like common sense for humans.
- 2010 Never Ending Language Learner (NELL)


- Just like how we look for multiple sources when writing a paper, NELL uses repetition and multiple sources to build confidence that the facts it's finding are actually true. (However, is it really true? 三人成虎)

Over and over again, NELL will use known relationships to find new objects, and known objects to find new relationships -- creating a huge knowledge base.
E.g. "Who wrote The Bluest Eye?" -> wrote(?,The Bluest Eye)
- AI systems have a tough time with nuance and incomplete data! ("Who invented time machine?)
- AI systems are influenced by any biases in data online.
# 18. Algorithmic Bias and Fairness:
- Algorithm Bias: Biases that exist in the real world are mimicked or even exaggerated by AI systems.
- Bias & Discrimination
5 types of algorithm bias:
- Data reflects existing biases in society. (cultural biases that might change over time) -> Correlated Features (protected class)
- Unbalanced Classes in Training Data.
- Data doesn't capture the right value. (Hard to quantify. But have to settle easily measurable shortcuts)
- Data amplified by a feedback loop. ( A positive feedback loop basically means "amplifying what happened in the past"... whether or not this amplification is good.)
- Malicious data attack or manipulation. (Microsoft 2014 Xiaoice in China -> 2016 Twitterbot Tay "coordinated attack by a subset of people")
- Correlation /= Causality!
Monitoring AI for bias and discrimination:
- Understand that algorithms will be biased. It's important to be critical about AI recommendations, instead of just accepting that "the computer said so." (Transparency in algorithms!!! The ability to examine inputs and outputs to understand why an algorithm is giving certain recommendations. But hidden layers in deep learning can be tricky to interpret.)
- If we want to have less biased algorithms, we may need more training data on protected classes like race, gender, or age. Looking at an algotithm's recommendations for protected classes may be a good way to check it for discrimination.
# 19. Cat VS Dogs? Let's make an AI to settle this (LAB):
URL: https://colab.research.google.com/drive/1N5IdMTmiNbwEOD8dqammN8GAfpk41arw
- Step 1: Gather data
- Step 2: Build an AI model (Multi-Layer-Perception, SKLearn)

only need to specify the size of the hidden layer

- Step 3: Select a pet
- Step 4: Audit the model for bias (data collection bias)
- Mistake: My data doesn't actually have the same distributions as the real world. -> Collect the true frequencies of each feature from a large random group of per owners √
- Mistake: The data had a correlated feature, so my AI found patterns that I didn't want. -> most important features √
Human check to avoid bias:
- Does the data match my goals?
- Does the AI have the right features?
- Am I really optimizing the right thing?
# 20. The Future of Artificial Intelligence:


Autonomous car level 1: Cruise control automatically accelerates and decelerates to keep the car at a constant speed.
- Artificial General Intelligence (AGI)

- 1950 Alan Turing "Computing Machinery and Intelligence": Turing Test.
The interrogator talks to the hidden players and tries to figute out which is a human and which is a machine. (Talking points given)
The goal of The Imatation Game was to test a machine's intelligence about any human thing, from math to poetry.
Turing -- " We do not wish to penalize the machine for its inability to shine in beauty competitions, nor to penalize a man for losing in a race against an aeroplane." -> Goal for AGI

- Yoland Gil & Bart Selman: Computing Research Association's AI Roadmap for the next 20 years (They predict AI reducing healthcare costs, personalizing education, accelerating scientific discoveries, helping national defense, and more.)
URL: https://arxiv.org/abs/1908.02624v1

- If self-driving vehicles revolutionize transportation in the near future -> drivers lose their job?

- Carbon footprint of running AI algorithms.
- AI systems can have all kinds of biases you may not want. -> benifits and costs of massive AI deployment.
Questions to a company or government rolling out a new technology:
- Where do they get their data?
- Is this even a situation where we want AI to help humans?
- Is this the right tool to use?
- What privacy are we giving up for this cool new feature?
- Is anyone auditing this model?
- Is this AI really doing what the developers hoped it would?
More free recourses to learn about AI:
- Practical Deep Learning - URL: https://course.fast.ai/
- AI for everyone - URL: https://www.coursera.org/learn/ai-for-everyone?
- Supervised Learning in Machine Learning: Regression and Classification - URL: https://www.coursera.org/learn/machine-learning
- Deep Learning with Pytorch: A 60 Minute Blitz - URL: https://pytorch.org/tutorials/beginner/deep_learning_60min_blitz.html
- Kaggle Learn - URL: https://www.kaggle.com/learn
- Kaggle Competitions - URL: https://www.kaggle.com/competitions
【速成課:人工智能】Ai - [21集全/中英雙語(yǔ)] - Artificial的評(píng)論 (共 條)
