Day 4 Quest

Decision Blade: Inputs, Weights and Bias

Quest: What do three stacks and a bias gem actually mean?

Today Craft Lab becomes a forge.

Sunny Sword, Homework Bow and Rain Shield are the materials (inputs: on or off). Enchant stacks are weights. The gem in the hilt is bias.

Franklin walks the world (arrow pad + TALK), forges the Decision Blade, then fights six chest foes in the arena. Same neuron maths as Days 1–3. New skill: reading what each stack means.

<Franklin>

Is the Rain Shield a weapon that says no?

Craft Lab World · Day 4 quest

CRAFT LAB WORLD

🌲
🌲
▓
▓
⛰CAVE
⛰
▓
🌲
⛰
▓
🏠LAB
🏠
🏠
🏠
🏠
🌲
🌲
🌲
🌲
~
~
~
🌲
🌲
🌲
🌲
🌲
🌲
🌲
🌲
🌲
Training Golem
Franklin

Arrows / WASD or on-screen pad. Walk near the Golem, then TALK (or E).

Franklin Track

  1. Walk to the Training Golem (on-screen arrows or WASD).
  2. Tap TALK (or press E).
  3. Forge: change enchant stacks with + / −. Toggle materials ON/OFF and watch YES/NO.
  4. Hit Load trained stacks if you want the Day-3 brain.
  5. Enter the arena. Score 6/6.
  6. Explain why rain gets a redstone torch.

Dad Track

z = sunny·w0 + homework·w1 + rain·w2 + bias
p = sigmoid(z)
YES if p ≥ 0.5
MetaphorMaths
Material ON/OFFinput xᵢ ∈
Enchant stackweight wᵢ
Redstone torch on stackweight is negative
Bias gemb
Arena hitcorrect classification

Negative rain weight is not “magic hate.” It is what the chest taught Bolt.

Franklin's Question

<Franklin>

If homework stack is big, does that mean homework matters a lot?

Yes. A bigger |weight| means that material pushes harder. Sign says which way.

Could Franklin explain it back?

"Inputs are which weapons are in your hand. Weights are how strong each one pushes. Bias is the starting lean before you pick anything up."

Scientific method (tiny)

  1. QUESTION — Do trained stacks classify all six chest rows?
  2. HYPOTHESIS — Yes, and rain weight is negative.
  3. EXPERIMENT — Load trained stacks; run arena.
  4. CONTROL — Same six examples.
  5. MEASUREMENT — Hits out of 6; sign of rain weight.
  6. RESULT — See quest / Python script.
  7. CONCLUSION — Multi-input neuron is interpretable.
  8. NEXT QUESTION — What if two neurons vote? (Day 5.)

Item crafted

Item crafted!

Decision Blade

Emerald

Forged from Sunny Sword, Homework Bow and Rain Shield. Enchant stacks are weights. The gem is bias.

  • Multi-Input I
  • Bias Gem I
  • Rain Aversion II
Sunny Block
Rain Cloud
Emerald
Homework Book
Redstone Dust
→
Emerald
Emerald

Achievement Get!

Decision Blade

The command block

Command Blockday04_weapon.py
"""
Day 4: read multiple inputs, weights and bias as a forged weapon.

z = sunny*w0 + homework*w1 + rain*w2 + bias
prediction = sigmoid(z)
YES if prediction >= 0.5

Trained stacks (~40 furnace ticks from Day 3 start) should beat all 6 chest rows.
Rain weight should be negative (redstone torch).
"""

import math

X = [
    [1.0, 1.0, 0.0],
    [1.0, 0.0, 0.0],
    [0.0, 1.0, 1.0],
    [1.0, 1.0, 1.0],
    [0.0, 1.0, 0.0],
    [0.0, 0.0, 0.0],
]
Y = [1.0, 0.0, 0.0, 0.0, 1.0, 0.0]
LABELS = [
    "Sunny + homework",
    "Sunny, no homework",
    "Rain + homework",
    "Sunny but raining",
    "Homework, cloudy",
    "Nothing going on",
]

# After ~40 Day-3 furnace ticks
weights = [-0.216, 1.41, -1.803]
bias = -0.879


def sigmoid(z: float) -> float:
    z = max(-20.0, min(20.0, z))
    return 1.0 / (1.0 + math.exp(-z))


print("Weapon enchants:")
print(f"  Sunny Sword   w0 = {weights[0]:.3f}")
print(f"  Homework Bow  w1 = {weights[1]:.3f}")
print(f"  Rain Shield   w2 = {weights[2]:.3f}  {'TORCH' if weights[2] < 0 else ''}")
print(f"  Bias gem      b  = {bias:.3f}")
print()

hits = 0
for row, y, label in zip(X, Y, LABELS):
    z = row[0] * weights[0] + row[1] * weights[1] + row[2] * weights[2] + bias
    p = sigmoid(z)
    guess = 1 if p >= 0.5 else 0
    ok = guess == int(y)
    hits += int(ok)
    print(f"{label:22s}  z={z:6.2f}  p={p:.3f}  guess={guess}  truth={int(y)}  {'OK' if ok else 'MISS'}")

print(f"\nArena score: {hits}/6")
print("Rain torch means: rain pushes away from YES (play outside).")
python3 content/lab/days/day-004/day04_weapon.py
Oak SignDad's Lab Notes (tap to open)
Wanted to learn
Understand multiple inputs, weights and bias as readable parts of one decision.
Learned
Materials = inputs, enchant stacks = weights (torch = negative), gem = bias. z = x·w + b, then sigmoid.
Built
Weapon forge + arena quest, on-screen D-pad/Talk controls, Decision Blade item, Eval Shield, day04_weapon.py.
Confused me
Why bias can look like a lonely weight with no material. (It always fires.)
Failed
Starting stacks of 0.5/0.5/0.5 miss the arena. That is intentional; load trained stacks or tune.
Taught Franklin
Franklin: rain torch means rain pushes away from playing outside.
Tomorrow
Two neurons working together.

Tomorrow

Day 5: two neurons working together.

Your personal notes

Loading…