GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Module 04 Module 04
Anurag Prasad edited this page
⬅️ Module 03 · 🗺️ Curriculum · 🏠 Home · Module 05 ➡️
On this page: Overview and learning goals · Beginner: the big picture · Core concepts and derivations · Worked example · Implementation · Advanced topics · Pitfalls and best practices · Conceptual questions and answers · Sources and further reading Neural networks began as mathematical models of neurons. This module follows the idea from biology, to the McCulloch–Pitts threshold unit, to Rosenblatt's learning perceptron, and ends with the XOR problem that shows why a single unit is not enough and motivates hidden layers (Module 07). After this module you should be able to:
A biological neuron collects signals through dendrites, sums them in the cell body (soma), and if the total is large enough fires a spike along the axon; synapses are the connections whose strength can change with experience — the biological analogue of weights. An artificial neuron keeps only this skeleton: weighted sum, then threshold. This is a very loose abstraction; real neurons are spiking, dynamic and far more complex, so treat the analogy as inspiration, not explanation. flowchart LR
x1["x1"] -->|"w1 (synapse)"| S["Sum: w.x + b (soma)"]
x2["x2"] -->|"w2"| S
x3["x3"] -->|"w3"| S
S --> T["Threshold: 1 if sum >= 0 (fire)"]
T --> Y["Output y (axon)"]
Excitatory synapses push the neuron toward firing, inhibitory ones away. In artificial units this is the sign of a weight: The 1943 model takes binary inputs With weights
NAND alone is functionally complete, so networks of threshold units can compute any Boolean function — but may need hidden layers. A unit with weights Rosenblatt's perceptron generalises to real weights and inputs: For labels Nothing changes when the prediction is correct. A false negative (
Figure 4.1 — AND has a separating line; no single line separates XOR. Original figure ( Novikoff (1962). If the data lie within radius Proof sketch. After If the data are not separable, the algorithm never converges — it cycles. Suppose Learn AND with
Final check: import numpy as np def train_perceptron(X, y, eta=1.0, epochs=100): w, b = np.zeros(X.shape[1]), 0.0 for _ in range(epochs): mistakes = 0 for xi, yi in zip(X, y): yhat = int(w @ xi + b >= 0) if yhat != yi: w += eta * (yi - yhat) * xi; b += eta * (yi - yhat); mistakes += 1 if mistakes == 0: break return w, b X = np.array([[0,0],[0,1],[1,0],[1,1]]); print(train_perceptron(X, np.array([0,0,0,1]))) # AND print(train_perceptron(X, np.array([0,1,1,0]))) # XOR: never reaches 0 mistakes
Q1. What is the role of the bias? Show answerIt shifts the decision hyperplane away from the origin; without it, every boundary passes through Q2. How do excitatory and inhibitory inputs map to weights? Show answerPositive weights are excitatory, negative weights inhibitory; magnitude is synaptic strength. Q3. Why can a single perceptron not compute XOR? Show answerXOR's positive and negative points cannot be separated by one hyperplane; the four linear inequalities are mutually inconsistent (proof above). Q4. State the perceptron convergence theorem and its key assumption. Show answerIf the data are linearly separable with margin Q5. Why does the update rule move Show answerAdding Q6. Why is NAND significant? Show answerIt is functionally complete: any Boolean function can be built from NAND gates, so threshold networks are universal for Boolean logic given enough depth. Q7. What changes between the perceptron and logistic regression? Show answerThe hard step becomes a smooth sigmoid, the output a probability, the loss cross-entropy, and training uses gradients rather than mistake-driven updates. Q8. What happens if you run the perceptron on non-separable data? Show answerIt never reaches zero mistakes; weights cycle indefinitely, so you need a stopping rule or a different algorithm.
⬅️ Module 03 · 🗺️ Curriculum · 🏠 Home · Module 05 ➡️ 🏠 Home · 🗺️ Curriculum · 🧭 Learning paths · ❓ Question bank · 📖 Glossary · 📚 References · ✏️ Contributing 🏠 Home · 🗺️ Curriculum · 🧭 Learning paths ❓ Question bank · 📖 Glossary · 📚 References Jump to module: 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 Part 1 · Mathematical foundationsPart 2 · Neural network fundamentalsPart 3 · Training deep networksPart 4 · Core architecturesPart 5 · Representation and generative learningPart 6 · Specialised, modern and responsible deep learningClone this wiki locally | ||||||||||||||||||||||||||||||||||||||||
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |