Theano tutorials?

I see that 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 ( (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 =,xx)
        y =, xx)
    return y

Could someone link some fairly in-depth Theano turorials?

1 Like

Maybe this one can help:

1 Like

This is awesome, thank you!

See also: