ContentsFoundations to FrontierBezhig

graduate_code/starters/attention.py

All lab code. Download this file.

# Exercise scaffold. Reference implementation is in a separate directory.
"""G14: single-head scaled dot-product attention, not a trained transformer."""
import math

def softmax(scores, allowed=None):
    raise NotImplementedError('Implement this contract from the book.')

def attention(Q, K, V, causal=False):
    raise NotImplementedError('Implement this contract from the book.')