Search code examples
apihttpluatorch

HTTP Server Using Lua/ Torch7


I'm starting to learn Torch7 to get into the machine learning/ deep learning field and I'm finding it fascinating (and very complicated haha). My main concern, however, is if I can turn this learning into an application - mainly can I turn my Torch7 Lua scripts into a server that an app can use to perform machine learning calculations? And if it's possible, how?

Thank you


Solution

  • You should look at Torch as a library (even though you may be accessing it as a standalone executable). That library can be used from some Lua code that is accessible through HTTP. The Lua code may be running inside OpenResty, which would take care of all HTTP interactions, and you get the same performance as OpenResty can be configured to use LuaJIT.

    Another option is to use HTTP processing based on luasocket and copas libraries (for examples, Xavante) or use one of the options listed on LuaWebserver page.