Skip links

Cloud Computing with Mathematica

Mathematica provides excellent support for cloud computation, and most of the time, it is a very simple and intuitive process. Today, let us look at some examples of cloud deployment.

For using Mathematica’s cloud capabilities, you need an appropriate subscription.

I use Mathematica Desktop, which comes with some free cloud credits.

OK, let us get started.

FormFunction[] represents an active form that allows data entry. Here is a simple form to accept two integers and return the product of the two:

FormFunction
FormFunction

When you execute it, this is what you see:

Result of FormFunction
Result of FormFunction

Let us turn this into a cloud function. All that we have to do is to wrap the expression around CloudDeploy[] function, and add a few formatting options.

CloudDeploy
CloudDeploy

When we execute this, Mathematica deploys it to the cloud and returns  a unique URL for it. We can click on the URL to open the form in a browser.

The Form
The Form

When we enter two integers and click submit, this is what we get:

The Result
The Result

Let us look at a slightly more complex example. This time, let us set up a form that allows users to upload an image, and then apply HistogramTransform[] on it. This particular function tries to equalize the image histogram. Mathematica has several such functions that come in handy in the area of computational photography.

HistogramTransform Example
HistogramTransform Example

When you click on the URL, you will be taken to this form:

HistogramTransform Example
HistogramTransform Input Form

You can drag and drop an image onto the form and then click the Submit button.

HistogramTransform Example
HistogramTransform Example

The result is calculated and returned almost immediately.

Equalization Result
Equalization Result

Our last example concerns object identification in an image. We use the function ImageIdentify[] for this.

Image Identification Example
Image Identification Example
Image Identification Input Form
Image Identification Input Form
Image Identification Result
Image Identification Result

We have barely scratched the surface in terms of cloud computing features of Mathematica. There are many more functions in this category and we shall see more of them in future posts.

Thanks for your time!

Leave a Reply to Leela rakesh Cancel reply