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.
Is the Rain Shield a weapon that says no?
Craft Lab World · Day 4 quest
CRAFT LAB WORLD
Arrows / WASD or on-screen pad. Walk near the Golem, then TALK (or E).
Franklin Track
- Walk to the Training Golem (on-screen arrows or WASD).
- Tap TALK (or press E).
- Forge: change enchant stacks with + / −. Toggle materials ON/OFF and watch YES/NO.
- Hit Load trained stacks if you want the Day-3 brain.
- Enter the arena. Score 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
| Metaphor | Maths |
|---|---|
| Material ON/OFF | input xᵢ ∈ |
| Enchant stack | weight wᵢ |
| Redstone torch on stack | weight is negative |
| Bias gem | b |
| Arena hit | correct classification |
Negative rain weight is not “magic hate.” It is what the chest taught Bolt.
Franklin's Question
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)
- QUESTION — Do trained stacks classify all six chest rows?
- HYPOTHESIS — Yes, and rain weight is negative.
- EXPERIMENT — Load trained stacks; run arena.
- CONTROL — Same six examples.
- MEASUREMENT — Hits out of 6; sign of rain weight.
- RESULT — See quest / Python script.
- CONCLUSION — Multi-input neuron is interpretable.
- NEXT QUESTION — What if two neurons vote? (Day 5.)
Item crafted
Item crafted!
Decision Blade
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
Achievement Get!
Decision Blade
The command block
day04_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
Dad'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…
