Complete the LoRALayer class so it wraps a frozen linear layer with a trainable low-rank adapter that starts as an identity function.
You're building a parameter-efficient fine-tuning system. Instead of fine-tuning all 768x768 = 590K parameters of a linear layer, LoRA freezes the original weights and adds a low-rank update through two small matrices A (in x rank) and B (rank x out). At initialization, B is zeros so the adapter has no effect. During training, only A and B are updated, reducing trainable parameters by 50-100x. Your task is to implement this from scratch using NumPy.
Ask me about the code, bugs, or concepts.
I'll guide you in plain English, no code output.
Budget: 50K tokens per lab