LoRA Forward Pass
~12 mincode completion
Implement lora_forward(W0, A, B, alpha, x) returning h as an array of shape (d,).
Where this shows up
~12 min
••••••••••••••••
8 employers weight this skill
4 frontier labs, 3 AI product companies, 1 enterprise vendor. Top match scores 81.
Python
import numpy as np
def lora_forward(W0, A, B, alpha, x):
"""
Output of a LoRA-adapted linear layer.
Args:
W0: frozen weight, shape (d, k)
A: down-projection, shape (r, k)
B: up-projection, shape (d, r)
alpha: LoRA scaling constant
x: input vector, shape (k,)
Returns:
array of shape (d,): W0 x + (alpha / r) B A x
"""
# YOUR CODE HERE
pass