Building AVA

Adrian Hoe 
Ava AI
Published in
4 min readApr 13, 2017

--

I dive into the future but I’m blinded by the sun. I’m reborn in every moment so who knows what I’ll become.

~ Selena Gomez

Many years ago, I was telling someone who was very close to me that the future would be computing. Last year, I began to talk about (quantum) artificial intelligence and supercomputing. There were many late night discussions with my partner about the topics, especially how artificial intelligence would change the way we live. In fact, artificial intelligence has been built into products such as the smartphone operating system and social media.

In the late 1990’s, I dreamed of building a Beowulf cluster using DEC Alpha and I was in talk with COMPAQ/DEC about the project. Later the idea was abandoned due to high cost and I was unable to secure government funding.

Last year, these late night discussions ignited my fire again and several affordable options came onto my radar screen. We locked on to commodity hardware, the Raspberry Pi 3 (Raspi 3), according to the requirement of the applications.

Several key areas have been identified and documented. I proceeded in developing concepts rather than the technical development. It was until last Christmas when I received this Raspberry Pi 3 Model B as my Christmas present from my partner and we began building the bits and pieces.

This Raspi 3 sports a 1.2 GHz, 64-bit, quad-core ARM Cortex A53 processor together with a 24 GFLOPS GPU. The CPU has a peak theoretical performance of about 175 MFLOPS (Linpack Double Precision). The Raspi 3 has a power rating of 4.0 W.

A cluster of 64 Raspi 3 will give some gross peak performance of 1,675 GFLOPS (or 1.675 TFLOPS). The performance and power ratio is about 6.5 GFLOPS per Watt.
The total performance of a 64-node Raspi 3 cluster is lower than the top-spec Apple 27” 5K Retina iMac sporting a Core i7 but we will have a total of 256 CPU cores and 64 GPUs to distribute computing tasks.

Here’s the photo of the Raspi 3 board showing the size comparison with a pen.

Here is the closer look of Raspi 3 or master node 0 when hooked up and ready to be powered on.

Master node 0 was powered on and connected to a 42” LCD TV. The required software packages were installed and some customization was made. Ava’s hardware was ready to rock and roll.

Next, I examined every popular instant messaging platforms available and finally decided to use [matrix] (http://matrix.org/) as the communication tool with Ava. The [matrix] uses a simple and lightweight client-server REST API to let clients send messages, control rooms and synchronise conversation history.

Using the REST API, I wrote a communication bot in Ada. The photo below shows the communication bot running on Ava and sent a test message to my iPhone. On my iPhone, I use the Riot app to communicate with Ava.

English is the main language to communicate with Ava. Building Ava’s English vocabulary is like teaching a child to speak. At this moment, the word list consists of some simple words for commonly used commands.

I used the NLTK to write a simple Python program to classify sentences into POS (Part of Speech). This video shows the Python program classifies sentences into POS using Penn Treebank POS tags.

Some of the simple ideas were to use the GPIO (General Purpose Input Output) on Raspi 3 to control LED lights. I bought some electronics and connected the components as in the photo below. The next thing I needed to do was to write a program to access the GPIO ports.

The Ada thick binding for WiringPi was ready for testing. Unfortunately, it did not work when I ran the demo program. Spent many nights trying to find the problem. After lots of reading, I found out that WiringPi uses different pin numbering scheme. The LEDs were connected to physical GPIO pin 11, 13 and 15 but WiringPi numbered them as pin 0, 2 and 3 respectively.

I changed the pin number in the demo program and it worked!

On Valentine’s Day, a simple data mining using Google Search Engine API was completed and Ava was able to find POI (Point Of Interest) based on parameters I gave her. She is still not capable to do a fully automated data mining yet. Ava should one day understand “Where are the locations of wall painting in Georgetown, Penang and what are the good foods within that area?”

Then, I added the capability to send images to the communication bot. Two days later, I did a simple integration and the result is as in the photo which showed a map with convex hull computed using Jarvis march algorithm:

Ava is still very much in her embryonic stage. Her hardware status is currently one node (Master node 0). Every software component is still work-in-progress and does not integrate with each other. The central piece of Ava is a separate project which I have worked on since last year, code named Amygdala Cortex, a client-server REST API.

I have made a concept video demonstrating one of the nine concepts of Ava. The video is published on my Vimeo channel.

What do you think? Any ideas or suggestions? Please drop me your comment or direct message. it will be great to hear from you.

My next article in this series: Building Ava — Amygdala Cortex, The REST API.

Originally published at adrianhoe.com on April 13, 2017.

--

--

Adrian Hoe 
Ava AI

A software architect/developer, founder of @Mind_Companion, building an artificial intelligence at home.