Skip to main content

Posts

Showing posts from November, 2017

Convolutional Neural Networks - CNNs

https://ujjwalkarn.me/2016/08/11/intuitive-explanation-convnets/ Convolution:  The primary purpose of Convolution in case of a CNNs is to extract features from the input image. Convolution preserves the spatial relationship between pixels by learning image features In the computation above we slide the orange matrix over the original image (green) by 1 pixel (also called ‘stride’) and for every position, we compute element wise multiplication (between the two matrices) and add the multiplication outputs to get the final value which forms a single element of the output matrix (pink). Note that the 3×3 matrix “sees” only a part of the input image in each stride. In CNNs terminology, the 3×3 matrix is called a ‘filter‘ or ‘kernel’ or ‘feature detector’ and the matrix formed by sliding the filter over the image and computing the dot product is called the ‘Convolved Feature’ or ‘Activation Map’ or the ‘Feature Map‘. It is important to note that filters acts as feature dete

Machine Learning - Model Evaluation Metrics

Confusion Matrix: ROC (Receiver Operating Characteristics) and Area Under Curve (AUC) ROC graphs are two-dimensional graphs in which tp rate (true positive rate or recall in above diagram) is plotted on the Y axis and fp rate is plotted on the X axis. An ROC graph depicts relative tradeoffs between benefits (true positives) and costs (false positives). More details: An introduction to ROC analysis by Tom Fawcett For example, when you consider the results of a particular test in two populations, one population with a disease, the other population without the disease, you will rarely observe a perfect separation between the two groups. Indeed, the distribution of the test results will overlap, as shown in the following figure. For every possible cut-off point or criterion value you select to discriminate between the two populations, there will be some cases with the disease correctly classified as positive (TP = True Positive fraction), but some cases with the dise

Deploy a Python app on Google Cloud

STEPS: TUTORIALDIR=src/[YOUR_PROJECT_ID]/python_gae_quickstart-2017-11-01-23-03 git clone https://github.com/GoogleCloudPlatform/python-docs-samples $TUTORIALDIR cd $TUTORIALDIR/appengine/standard/hello_world dev_appserver.py $PWD gcloud app deploy app.yaml --project [YOUR_PROJECT_ID] The app runs on: https://[YOUR_PROJECT_ID].appspot.com/ Flask App on Google App Engine: cd $TUTORIALDIR/appengine/standard/flask/tutorial gcloud app deploy app.yaml --project [YOUR_PROJECT_ID] Run the Flask app on: https://[YOUR_PROJECT_ID].appspot.com/form Example:  /src/tantal-183814/python_gae_quickstart-2017-11-01-23-03/appengine/standard/flask/tutorial Using the Container Engine : https://cloud.google.com/container-engine/docs/quickstart#optional_hello_app_code_review This example makes use of a web app framework - a  web application framework can simplify development by taking care of the details of the interface, letting you focus development effort on your applications featur

Google Cloud - Natural Language API

Apart from the Quickstart here: https://cloud.google.com/natural-language/docs/ I used this code: https://raw.githubusercontent.com/GoogleCloudPlatform/python-docs-samples/master/language/cloud-client/v1/quickstart.py I had to do a few additional steps including: Setting up Google Application Default Credentials - including setting the environment variable GOOGLE_APPLICATION_CREDENTIALS Well described here: https://developers.google.com/identity/protocols/application-default-credentials Then I had to disable unwanted warnings based on the details here: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings