Machine learning adapting its own processes

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Machine learning adapting its own processes

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. A machine learning program finds that its last decision was wrong. What does it do next?
A It changes its own processes so it decides better next time
B It keeps the same process and waits for a human to rewrite the code
2. Who changes the decision-making rules when a machine learning program improves?
A The program changes its own rules
B A programmer must rewrite the code each time
3. A chess program loses a game and then plays a different strategy in the next game because of what it learned. Which statement describes this?
A The program is following a fixed set of rules that never change
B The program improved its strategy by learning from past results
4. Which one is an example of a machine learning program adapting its own processes?
A A calculator always adds numbers using the same steps
B A game program adjusts its moves after losing, using the results of earlier games
5. What does 'processes' mean in 'a machine learning program can change its own processes'?
A The way the program makes its decisions
B The physical parts inside the computer

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1if guess_was_wrong: update_rules() AA game program uses what happened in earlier games to improve its own strategy.
2strategy = improve(strategy, game_history) Brules = learn_from(past_results)
3A machine learning program changes how it makes decisions using what happened before, with no human rewriting the code. CMachine learning programs change their own processes using past data, so no human has to rewrite the code each time.
4After a wrong result, the program adjusts its own rules instead of waiting for a programmer. DA machine learning game program uses earlier results to change and improve its strategy, so ignoring them is not adaptive.
5A programmer must rewrite the code every time a machine learning program improves. Eif result != correct: adjust(rules)
6A game program keeps the same strategy and ignores what happened in earlier games. FAfter a wrong result, the program changes its own rules so it decides better next time.

Definitions

adaptive processes

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
IF result = "wrong" ____ score ← score - 1 ENDIF
2.
IF result = "win" THEN score ← score _ 1 ENDIF
3.
IF score _ 0 THEN DISCARD(rule) ENDIF
4.
___ game ← 1 TO 1000 result ← PlayGame(strategy) strategy ← Adjust(strategy, result)
5.
strategy _ Adjust(strategy, result) PRINT("Strategy updated") PRINT("No human edited the code")

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A guess ← predict(game_state)
B IF guess ≠ result THEN
C rule ← fixed_rule
D ENDIF
Question 2
A FOR game ← 1 100
B move ← pick(strategy)
C result ← play(move)
D strategy ← learn(result)
E NEXT game
Question 3
A WHILE games < 50
B result ← play(strategy)
C games ← games + 1
D strategy ← update(games)
E ENDWHILE
Question 4
A prediction ← model(email)
B IF prediction = label THEN
C model ← adjust(model)
D ENDIF
Question 5
A error ← target - output
B step ← 0.1 * error
C weight ← step
D OUTPUT weight

Answer Key

Machine learning adapting its own processes
Section A: Quick Questions
Q1
A — It changes its own processes so it decides better next time
Q2
A — The program changes its own rules
Q3
B — The program improved its strategy by learning from past results
Q4
B — A game program adjusts its moves after losing, using the results of earlier games
Q5
A — The way the program makes its decisions
Section B: Match the Pairs
Q1
if guess_was_wrong: update_rules() → After a wrong result, the program changes its own rules so it decides better next time.
Q2
strategy = improve(strategy, game_history) → A game program uses what happened in earlier games to improve its own strategy.
Q3
A machine learning program changes how it makes decisions using what happened before, with no human rewriting the code. → rules = learn_from(past_results)
Q4
After a wrong result, the program adjusts its own rules instead of waiting for a programmer. → if result != correct: adjust(rules)
Q5
A programmer must rewrite the code every time a machine learning program improves. → Machine learning programs change their own processes using past data, so no human has to rewrite the code each time.
Q6
A game program keeps the same strategy and ignores what happened in earlier games. → A machine learning game program uses earlier results to change and improve its strategy, so ignoring them is not adaptive.
Section C: Definitions
Q1
adaptive processes — A machine learning program changes its own processes, meaning how it makes decisions, using what happened before, so no human has to rewrite the code.
Section D: Fill in the Blanks
Q1
IF result = "wrong" THEN score ← score - 1 ENDIF
Q2
IF result = "win" THEN score ← score + 1 ENDIF
Q3
IF score < 0 THEN DISCARD(rule) ENDIF
Q4
FOR game ← 1 TO 1000 result ← PlayGame(strategy) strategy ← Adjust(strategy, result)
Q5
strategy ← Adjust(strategy, result) PRINT("Strategy updated") PRINT("No human edited the code")
Section E: Spot the Error
Q1
C — After a wrong result the program should adjust its own rule using that result, for example rule ← adjust(rule, result). Setting it to a fixed rule means nothing is learned.
Q2
A — A FOR loop needs the keyword TO between the start and end values. It should be FOR game ← 1 TO 100, so the program can play 100 games and keep learning.
Q3
D — The strategy must change based on what happened, which is the result of the game. It should be update(result), not update(games). The number of games played does not show what worked.
Q4
B — The program should change its own decision process when its prediction was wrong. The condition should be prediction ≠ label, not =, which would adjust when it was already right.
Q5
C — The weight should be adjusted a little using the old value, so it should be weight ← weight + step. Writing weight ← step throws away everything learned before.