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


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


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



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.


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.


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