Skip to main content
2 of 3
added 267 characters in body
wlad
  • 4.9k
  • 2
  • 21
  • 45

You can sample from the product $Ax$ in the following way:

Sample a row of $A$ and multiply by $x$. To save memory, forget the row. Sample another row of $A$ and multiply by $x$. To save memory, forget the row. And so on.

An even faster way of calculating $a^T x$ where $a$ is a row of $A$ is to simply sample from $N(0, \sigma |x|^2)$. This follows from the formula for the sum of two normal distributions, which can be straightforwardly generalised to the sum of $n$ normal distributions.

wlad
  • 4.9k
  • 2
  • 21
  • 45