NASA Space Apps Challenge at Hursley

October 20th, 2019

This weekend was NASA Space Apps Challenge again – a weekend space-themed hackathon organised by NASA. It runs around the world, and this year IBM Hursley hosted one again.

I was in a small team with Faith. There were a variety of challenges to choose from and we chose Orbital Scrap Metal which was about educating the public about orbital debris, or space junk – explaining what it is, where it comes from, and the potential impact it has.

We created a game to help kids learn about space debris while playing. It’s fun, educational, and is all driven by real live data about space debris – each time you play, you interact with different real debris items.

Read the rest of this entry »

Using Avro schemas from Python apps with IBM Event Streams

October 17th, 2019

I’ve written before about how to write a schema for your developers using Kafka. The examples I used before were all in Java, but someone asked me yesterday if I could share some Python equivalents.

The principles are described in the Event Streams documentation, but in short, your Kafka producers use Apache Avro to serialize the message data that you send, and identify the schema that you’ve used in the Kafka message header. In your Kafka consumers, you look at the headers of the messages that you receive to know which schema to retrieve, and use that to deserialize message data.

Read the rest of this entry »

Explaining machine learning with decision trees

August 18th, 2019

Machine Learning for Kids now includes interactive visualisations that explain how some of the machine learning models that children create work.

The tool lets children learn about artificial intelligence by training machine learning models, and using that to make projects using tools like Scratch. I’ve described how I’ve seen children learn a lot about machine learning principles by being able to play and experiment with it. But I still want the site to do more to explain how the tech actually works, and this new feature is an attempt to do that.

Read the rest of this entry »

Explaining Machine Learning for Kids (again)

August 7th, 2019

Two years ago, I made a video demo of Machine Learning for Kids. It still gets a lot of views by teachers (either individually or as part of CPD sessions) and volunteers (preparing for running a code club).

It has been looking increasingly out of date as the site has changed a bit in the last couple of years! So I’ve recorded a new walkthrough:

In the video, I show a variety of AI projects that school children have made, and discuss how they reacted to them and what I think they learned.

SQL queries on Kafka topics using Apache Hive

August 6th, 2019

Apache Hive is open source data warehouse software built on top of Hadoop. It gives you an SQL-like interface to a wide variety of databases, filesystems, and other systems.

One of the Hive storage handlers is a Kafka storage handler, which lets you create a Hive “external table” based on a Kafka topic.

And once you’ve created a Hive table based on a Kafka topic, you can run SQL queries based on attributes of the messages on that topic.

I was having a play with Hive this evening, as a way of running SQL queries against messages on my Kafka topics. In this post, I’ll share a few queries that I tried.


Read the rest of this entry »

Using OpenWhisk in Machine Learning for Kids

July 28th, 2019

I’ve moved a couple of bits of Machine Learning for Kids into OpenWhisk functions. In this post, I’ll describe what I’m trying to solve by doing this, and what I’ve done.

Background

I’ve talked before how I implemented Machine Learning for Kids, but the short version is that most of it is a Node.js app, hosted in Cloud Foundry so I can easily run multiple instances of it.

The most computationally expensive thing the site has to do is for projects that train a machine learning model to recognize images.

In particular, the expensive bit is when a student clicks on the Train new machine learning model button for a project to train the computer to recognize images.

Read the rest of this entry »

The Scratch coordinate system

July 23rd, 2019

In Scratch 3, the stage in the top right where your sprites live is implemented as an HTML canvas. Unfortunately the internal coordinate system used by Scratch logically to maintain state, and the coordinate system used by HTML canvases both work very differently.

For some of the Scratch blocks I’ve written for Machine Learning for Kids, I need to be able to convert between coordinates and sizes between the two different coordinate systems.

For example, my ML blocks can let a student use an image classifier they’ve trained to recognise what is on the background behind a certain Sprite in their project. To do that, the backdrop image block needs to:

  1. get the location of the Sprite (which will be returned using the Scratch coordinate system)
  2. get the image data of what is rendered on the canvas at that location (using HTML canvas APIs – using the HTML coordinate system)

I couldn’t find a way to convert between the two documented anywhere, and it was a tiny bit fiddly, so I’m documenting it here for the next time I need it!

Read the rest of this entry »

How to write your first Avro schema

July 20th, 2019

Any time there is more than one developer using a Kafka topic, they will need a way to agree on the shape of the data that will go into messages. The most common way to document the schema of messages in Kafka is to use the Apache Avro serialization system.

This post is a beginner’s guide to writing your first Avro schema, and a few tips for how to use it in your Kafka apps.

Read the rest of this entry »