Are there Google App Engine application apps for communicating or managing machine learning models or tasks?

I want to use the Google Machine Learning app with the App Engine app written in python.

This application should review TensorFlow models before each use due to the nature of the study (data clustering using Kohonen SOM).

I have the following questions:

Can an application-based application work with a machine to train a model with some input? Can an application based on App Engine send some input vector to an ML object and get the result (which cluster belongs to this vector)? If everything is possible, how to do it?

If none of this is possible, is there any other architecture that I can use to use an App Engine based application TensorFlow?

I say this: enter image description here

+4
source share
1 answer

Yes, you can use the App Engine to communicate with Google Cloud Machine Learning (hereinafter CloudML).

CloudML Python Google API, Google. App Engine, .

API , App Engine. App Engine.


, CloudML:

  • /

1.

. ( CloudML) CloudML.

API App Engine, , , quickstart. , , .

, , , GCS gcloud API, API ().

2.

( , 1) 2) - ( -). App Engine, , - ( ). , :

from oauth2client.client import GoogleCredentials
from googleapiclient import discovery

projectID = 'projects/<your_project_id>'
modelName = projectID+'/models/<your_model_name>'

credentials = GoogleCredentials.get_application_default()


ml = discovery.build('ml', 'v1beta1', credentials=credentials)
# Create a dictionary with the fields from the request body.
requestDict = {"instances":[
                    {"image": [0.0,..., 0.0, 0.0], "key": 0}
        ]}
# Create a request to call projects.models.create.
request = ml.projects().predict(
      name=modelName,
      body=requestDict)
response = request.execute()

{"image": <image_array>, "key": <key_id>} , , . response, .

+7

Source: https://habr.com/ru/post/1658903/


All Articles