Module 1 Assignment: Baseline MLP design brief

Module 1 Assignment: Baseline MLP design brief#

Theme#

From neurons to multilayer networks

Scenario#

A product analytics team has a small labeled dataset and wants a neural baseline before investing in a larger modeling effort.

Exercises#

  1. Specify the input tensor, target tensor, output activation, and loss for a tabular classification task.

  2. Modify the starter MLP by changing width or activation and document what changed in outputs or training behavior.

  3. Create a shape trace from raw input through hidden layers to the output head.

  4. Write a recommendation for whether this MLP is an acceptable baseline or only a learning probe.

Evidence Requirements#

  • A short explanation of the data, tensors, objective, and evaluation signal used in the starter experiment.

  • At least one meaningful modification to the starter code, with the changed variable named explicitly.

  • A comparison against the unmodified starter result or another defensible baseline.

  • A limitation statement that separates what the toy experiment demonstrates from what a production model would require.

Submission#

Submit a 600-900 word technical memo plus code, plots, tables, or shape traces needed to support your claims. The memo should read like a review artifact for another AI practitioner: concise, reproducible, and honest about uncertainty.

Rubric Focus#

  • Technical correctness and appropriate neural-network vocabulary.

  • Evidence from the starter experiment or a documented extension.

  • Connection between design choices and data/problem structure.

  • Clear treatment of limitations, failure modes, or next experimental gates.

import torch
from torch import nn

torch.manual_seed(1)
X = torch.randn(96, 4)
y = ((X[:, 0] - 0.5 * X[:, 1] + X[:, 2] ** 2) > 0.7).long()

model = nn.Sequential(nn.Linear(4, 12), nn.ReLU(), nn.Linear(12, 2))
loss_fn = nn.CrossEntropyLoss()
opt = torch.optim.Adam(model.parameters(), lr=0.03)

for epoch in range(80):
    opt.zero_grad()
    loss = loss_fn(model(X), y)
    loss.backward()
    opt.step()

with torch.no_grad():
    accuracy = (model(X).argmax(dim=1) == y).float().mean().item()

print(f"training accuracy: {accuracy:.3f}")
print("Change hidden width, activation, or learning rate, then compare results.")
training accuracy: 1.000
Change hidden width, activation, or learning rate, then compare results.

Reflection Prompts#

  • What changed when you modified the starter experiment, and why should that change matter?

  • Which result surprised you, and what diagnostic would you run next?

  • What assumption would you document before handing this model to another practitioner?

  • Which failure mode from the module reading is most relevant to your result?