Learning objectives
By the end you can:
- State what a neural network is in mechanical terms (an alternating stack of affine maps and elementwise non-linearities, fitted by gradient descent) and say precisely what the hidden layer buys that a linear model cannot have, plus what it costs.
- Implement the forward pass of a multi-layer perceptron in NumPy with correct shapes and bias broadcasting, keeping the intermediate values a backward pass will need.
- Derive backpropagation by hand for that network under both mean squared error and softmax cross-entropy, and implement it so that every gradient's shape matches its parameter's shape.
- Verify a gradient numerically with central differences, state the relative-error thresholds that mean right, wrong and look harder, and explain why the check is the only reason to trust a hand-derived backward pass.
- Implement softmax and cross-entropy in a numerically stable way (the row-max shift and log-sum-exp) and explain exactly which computation overflows without them and why the fused gradient collapses to
(P − onehot)/n. - Train a network end to end: He initialisation, a full-batch loop, a seeded and reproducible run, a loss curve, and a comparison against the mean baseline and an OLS line that says whether the non-linearity earned its keep.
- Name what deep learning is and is not good for in finance (where the data volume, signal-to-noise ratio and non-stationarity of market data put a hard ceiling on it) and describe what a framework (PyTorch/TensorFlow) adds to what you built, in terms of autodiff, hardware and ecosystem rather than magic.
- Turn a corpus of filings or news into a matrix: tokenisation, vocabulary, bag-of-words counts, and TF-IDF reproduced to nine decimal places against scikit-learn's own implementation.
- Build and evaluate a text classifier with a chronological split, a majority-class baseline reported alongside every accuracy, and the vectorizer fitted on training documents only, and explain why fitting on train-plus-test is look-ahead rather than mere sloppiness.
- Describe modern NLP conceptually (contextual embeddings, transformers, fine-tuning versus prompting, and finance-specific lexicons) and say what each buys over TF-IDF and what each costs in compute, latency and auditability.
- Build a walk-forward evaluation harness in which look-ahead is structurally impossible, not merely discouraged, and explain why a random train/test split on a time series is a wrong test rather than a weak one.
- Choose and compute honest forecast metrics (MAE, RMSE, MASE) say when each is the right loss, and state why MASE's denominator makes it comparable across a ₹800 share and a 4,500-point index.
- Compare any forecast against the mandatory naive benchmark, decide whether a difference is evidence or noise using a paired test, and report a loss to naive as a result rather than as a failure.
- (Productivity objective: R10 duality.) Use a coding copilot on deep-learning, NLP and forecasting code the way a working practitioner does, after you can derive it, and review its output for the failure modes specific to this material: silently wrong gradients that still train, hallucinated framework APIs, leaky pipelines, and evaluation code that scores the model against itself.
The duality, stated once (R10). The gated skill is objectives 1–13, and the gate is built to be hostile to shortcuts: the pack's hidden tests check gradients against numerical differentiation rather than stored values, feed inputs that only a numerically stable implementation survives, and, in
DA2.03-e10, require your code to report a loss to the naive benchmark, which no amount of prompt engineering will guess. Objective 14 is the payoff you keep. The app never calls an AI at runtime: every AI-Augment callout below asks you to generate something in your own tool, paste it back, and let the local hidden tests judge it. The machine drafts; the tests judge; you are the one who has to know why it failed.
Prerequisites & connections
Builds on. DA1.01 for NumPy, broadcasting, axes, @, and the habit of thinking in shapes rather than loops; if (n, d) @ (d, h) -> (n, h) is not automatic, one hour there saves five here. DA1.02 and DA1.03 for getting data into a tidy, correctly-indexed frame in the first place. DA1.05 for the statistical vocabulary the evaluation section speaks. DA2.01 for train/validation/test discipline, cross-validation and metric choice, and DA2.02 for pipelines, feature engineering and, critically, leakage, which this node extends from the tabular case into text and time. And CS1.04 for the cost model: a network is a stack of matrix multiplies, and you should be able to say what one epoch costs before you run it.