Which library for Non linear Conjugate Gradient on GAE for python?

49 views
Skip to first unread message

Sumanta Bhowmik

unread,
Feb 26, 2017, 11:42:08 AM2/26/17
to Google App Engine
 I do not want to write a Non linear CG implementation on my own. As far as I know, GAE(python) supports numpy but does not support scipy(which has optimization). I did not come across a pure python implementation on the net. But I am sure many people would have had similar requirements. Is there some library that I can use on GAE?

Nick (Cloud Platform Support)

unread,
Feb 27, 2017, 10:06:18 AM2/27/17
to google-a...@googlegroups.com
Hey Sumanta,

It's correct to say that the App Engine Standard Environment for python doesn't support modules based on C code. You could just go head and write the non-linear CG algorithm in pure python and attempt to run it, but there are two things to keep in mind:

* It seems you would have to write it. I searched a bit and couldn't find any pre-made code for this.

* scipy / numpy will be much faster.

I recommend you either offload these computation problems to a Compute Engine instance (possibly of g1-small or f1-micro machine type, although you could check out the other machine types according to your needs)

You could also deploy an App Engine Flexible Environment app where the Dockerfile uses pip to install your requirements.txt, containing the dependencies, so that when the app is deployed, you have numpy and scipy.

You can also find sample apps which install numpy and scipy in our github "python-docs-samples" repo (they're under "scipy" and "numpy").

Cheers,

Nick
Cloud Platform Community Support
Reply all
Reply to author
Forward
0 new messages