I see that deeplearning.net has been taken down, save for a handful for pages. I’ve run into functions like the below before, which I don’t really understand what’s happening or why.
This particular function came from a PyMC3 adaptation of a 2017 Google whitepaper. For the PyMC3 code, reference link 3.
Bayesian Methods for Media Mix Modeling with Carryover and Shape Effects – Google Research (whitepaper)
Bayesian Media Mix Modeling using PyMC3, for Fun and Profit | by Luca Fiaschi | HelloTech (hellofresh.com) (dumbed down writeup)
A Bayesian Approach to Media Mix Modeling by Michael Johns & Zhenyu Wang - YouTube (video reviewing the writeup)
def geometric_adstock(x, alpha=0.8,L=12,normalize=True):
w = tt.as_tensor_variable([tt.power(alpha,i) for i in range(L)])
xx = tt.stack([tt.concatenate([tt.zeros(i), x[:x.shape[0] -i]]) for i in range(L)])
if not normalize:
y = tt.dot(w,xx)
else:
y = tt.dot(w/tt.sum(w), xx)
return y
Could someone link some fairly in-depth Theano turorials?