Einstein Summation in Numpy

Olexa Bilaniuk's IFT6266H16 Course Blog

In Python’s Numpy library lives an extremely general, but little-known and used, function called einsum() that performs summation according to Einstein’s summation convention. In this tutorial article, we demystify einsum().

The only thing that the reader should need is an understanding of multidimensional Linear Algebra and Python programming. The reader will be better-prepared if he has, in the past, implemented the classic matrix multiplication using three nested loops in the language of his choice.

Why you should learn about it

The Einstein summation convention is the ultimate generalization of products such as matrix multiplication to multiple dimensions. It offers a compact and elegant way of specifying almost any product of scalars/vectors/matrices/tensors. Despite its generality, it can reduce the number of errors made by computer scientists and reduce the time they spend reasoning about linear algebra. It does so by being simultaneously clearer, more explicit, more self-documenting

View original post 2,150 more words

OpenGL ambient lighting on Oculus Rift

Electric Soup

Arkwood’s eyes were burnt out. Two smoldering holes in the front of his skull. Not quite.

‘But your virtual room is a health hazard,’ he said, slipping off the Oculus Rift virtual reality headset, ‘can’t you turn the lights down low?’

Yes. You only had to ask. I will dim the ambient light in the room.

Basic OpenGL lighting requires more than ambient light though. For example, as Learn OpenGL points out, the Phong lighting model incorporates diffuse and specular lighting too. But for now, let’s get started with just the ambient part.

Here’s the fragment shader for our virtual room, with the ambient light set to pure white:

And with an ambient strength of 1.0, the ambient light is having no effect on the overall textured colour of the room.

Note that the ambient light and strength are defined in the shader – we could pass these values…

View original post 206 more words

Deep Learning For Sequential Data – Part V: Handling Long Term Temporal Dependencies

Perpetual Enigma

1 mainIn the previous blog post, we learnt why we cannot use regular backpropagation to train a Recurrent Neural Network (RNN). We discussed how we can use backpropagation through time to train an RNN. The next step is to understand how exactly the RNN can be trained. Does the unrolling strategy work in practice? If we can just unroll an RNN and make it into a feedforward neural network, then what’s so special about the RNN in the first place? Let’s see how we tackle these issues.  

View original post 867 more words

Measuring The Memory Of Time Series Data

Perpetual Enigma

1-mainTime series data has memory. It remembers what happened in the past and avenge any wrongdoings! Can you believe it? Okay the avenging part may not be true, but it definitely remembers the past. The “memory” refers to how strongly the past can influence the future in a given time series variable. If it has a strong memory, then we know that analyzing the past would be really useful to us because it can tell us what’s going to happen in the future. If you need a quick refresher, you can check out my blog post where I talked about memory in time series data. We have a high level understanding of how we can classify time series data into short memory and long memory, but how do we actually measure the memory?  

View original post 578 more words

It’s been a hard day’s night of Deep Learning

ScienceAppliedForGood

test_orange_2016

Turning the page

The new year  is round the corner and so are the thoughts about a quest into the hidden layers of Deep Learning.  This year’s goal was to become a developer and it was achieved as planned on time. The main projects were in Android and the end of the year was under the sign of Machine Learning and ,more precisely speaking, Deep Learning.

Summary 

So what are the main points in almost a two month headlong journey on the Deep Learning highway?

Deep Learning Book

  • As you should have already known by now Deep Learning Book by Ian Goodfellow and Yoshua Bengio and Aaron Courville was published. This detailed and helpful book on foundations of artificial neural networks is pretty expensive but can be accessed electronically in html format for free.

Jason Brownlee’s Machine Learning Mastery site comes in handy

  • As for me I started to be interested in the…

View original post 351 more words

CCIE Program Refresh, My thoughts.

UCSguru.com

The world of technology as we know is changing fast, faster than many predicted. This is certainly true in the data center. In the “Old days” (more than 3 years ago) most of my time was spent evangelising a particular product or adjudicating a bake off between two or more vendor platforms.

These days the infrastructure conversations tend to be far shorter, the fact is infrastructure these days is a given, and the true differentiator is how easy that infrastructure is to consume, automate and orchestrate in a cloud stack or converged solution.

Gone are the days of product led engagements (and rightfully so) these days it’s all about solution led engagements. Taking a business requirement and translating that into a technical solution which truly drives business outcomes.

This solutions led approach, inevitably leads to a closer collaboration between teams across all elements of the cloud stack, portal developers, applications…

View original post 858 more words

Azure Resource Manager REST calls from Python

MSFT Stack

This article describes how to make REST calls to Azure Resource Manager (ARM) from Python. In particular, how to authenticate. Once you have an authentication token you just add it to your REST call headers when calling the Azure REST API.

Note: If you’re looking for the official Azure SDK for Python, go here: https://github.com/Azure/azure-sdk-for-python.

Initial Setup

Creating an Azure Resource Manager app requires some one-time setup steps:

  • Create an Azure Active Directory App
  • Create a Service Principal (an Active Directory “user” which represents an automated application) and grant it permissions
  • Create a credential  object and get the tenant ID.

These steps are well documented here: Authenticating a Service Principal with Azure Resource Manager, and are covered (using PowerShell) in steps 1-4 of my C# Azure REST write-up here: How to call the Azure Resource Manager REST API from C#.

If you follow these steps you will have the…

View original post 185 more words

Docker macvlan and ipvlan network plugins

Sreenivas Makam's Blog

This is a continuation of my previous blog on macvlan and ipvlan Linux network drivers. Docker has added support for macvlan and ipvlan drivers and its currently in experimental mode as of Docker release 1.11.

Example used in this blog

In this example, we will use Docker macvlan and ipvlan network plugins for Container communication across hosts. To illustrate macvlan and ipvlan concepts and usage, I have created the following example.

vlan4

Following are details of the setup:

  • First, we need to create two Docker hosts with experimental Docker installed. The experimental Docker has support for macvlan and ipvlan. To create experimental boot2docker image, please use the procedure here.
  • It is needed to enable promiscuous mode on the Virtualbox adapter. This allows for Container communication across hosts.
  • There are four Containers in each host. Two Containers are in vlan70 network and two other Containers are in vlan80 network.
  • We will…

View original post 715 more words

Email spam detection using apache spark mllib

Knoldus Blogs

In this blog we will see the real use case of spark mllib that is email spam detection. With the help of using the apache spark mllib component we will detect that email will goes in spam folder or primary folder.

So now jump into the programming and see how it will implement. So first we will load the data from training from spam dataset and primary dataset as follow

val spam = sc.textFile("/home/sandy/Spark/enron1/spam/0052.2003-12-20.GP.spam.txt", 4)
val normal = sc.textFile("/home/sandy/Spark/enron1/ham/0022.1999-12-16.farmer.ham.txt", 4)

Next we need to use HashinTF or IDF to find the frequency of word in the mail and create a Vector which is helpful in creating the LabelPoints for the training

val spamFeatures = spam.map(email => tf.transform(email.split(" ")))
val normalFeatures = normal.map(email => tf.transform(email.split(" ")))

With the help of vectors we will create the LabelPoints , LabelPoints are the input for our model we will create label points as follows

View original post 204 more words

Convolutional Neural Networks backpropagation: from intuition to derivation

Grzegorz Gwardys

Disclaimer: It is assumed that the reader is familiar with terms such as Multilayer Perceptron, delta errors or backpropagation. If not,  it is recommended to read for example a chapter 2 of free online book ‘Neural Networks and Deep Learning’ by Michael Nielsen.   

Convolutional Neural Networks (CNN) are now a standard way of image classification – there are publicly accessible deep learning frameworks, trained models and services. It’s more time consuming to install stuff like caffe than to perform state-of-the-art object classification or detection. We also have many methods of getting knowledge -there is a large number of deep learning courses/MOOCs, free e-books or even direct ways of accessing to the strongest Deep/Machine Learning minds such as Yoshua Bengio, Andrew NG or Yann Lecun by Quora, Facebook or G+.

Nevertheless, when I wanted to get deeper insight in CNN, I could not find a “CNN backpropagation for dummies”. Notoriously…

View original post 785 more words