{
let weight = 0.5;
for (let i = 1; i <= iterations; i++) {
let prediction = input * weight;
let error = Math.pow(prediction - goal, 2);
let directionAndAmount = (prediction - goal) * input;
weight = weight - directionAndAmount;
yield html`
Iteration:${i}<br>
Weight: ${weight}<br>
Error: ${error}<br>
Prediction: ${prediction}
`;
}
}