Fitting a spectra of gaussians

I am confused what is going on with the theano mixture model. How does it know the grid to put the function on? It looks like ‘x’ in your mixture model is not the same x array that I have in the code above?

Are there any examples of fitting non linear functions? I cannot find any after a pretty extensive search.