Edging Ahead When Learning On The Edge

“With the power of edge AI in the palm of your hand, your business will be unstoppable.

That’s what the marketing seems to read like for artificial intelligence companies. Everyone seems to have cloud-scale AI-powered business intelligence analytics at the edge. While sounding impressive, we’re not convinced that marketing mumbo jumbo means anything. But what does AI on edge devices look like these days?

Being on the edge just means that the actual AI evaluation and maybe even fine-tuning runs locally on a user’s device rather than in some cloud environment. This is a double win, both for the business and for the user. Privacy can more easily be preserved as less information is transmitted back to a central location. Additionally, the AI can work in scenarios where a server somewhere might not be accessible or provide a response quickly enough.

Google and Apple have their own AI libraries, ML Kit and Core ML, respectively. There are tools to convert Tensorflow, PyTorch, XGBoost, and LibSVM models into formats that CoreML and ML Kit understand. But other solutions try to provide a platform-agnostic layer for training and evaluation. We’ve also previously covered Tensorflow Lite (TFL), a trimmed-down version of Tensorflow, which has matured considerably since 2017.

For this article, we’ll be looking at PyTorch Live (PTL), a slimmed-down framework for adding PyTorch models to smartphones. Unlike TFL (which can run on RPi and in a browser), PTL is focused entirely on Android and iOS and offers tight integration. It uses a react-native backed environment which means that it is heavily geared towards the node.js world.

Continue reading “Edging Ahead When Learning On The Edge”

Rogue Waves Are Mysterious And Big

Stand by the shore and watch the waves roll in, and you’ll notice that most come in at roughly the same size. There’s a little variation, but the overwhelming majority don’t stand out from the crowd. On all but the stormiest of days, they have an almost soothing regularity about them.

Every so often though, out on the high seas, a rogue wave comes along. These abnormally large waves can strike with surprise, and are dangerous to even the largest of ships. Research is ongoing as to what creates these waves, and how they might be identified and tracked ahead of time.

Continue reading “Rogue Waves Are Mysterious And Big”

Making The Case For COBOL

Perhaps rather unexpectedly, on the 14th of March this year the GCC mailing list received an announcement regarding the release of the first ever COBOL front-end for the GCC compiler. For the uninitiated, COBOL saw its first release in 1959, making it with 63 years one of the oldest programming language that is still in regular use. The reason for its persistence is mostly due to its focus from the beginning as a transaction-oriented, domain specific language (DSL).

Its acronym stands for Common Business-Oriented Language, which clearly references the domain it targets. Even with the current COBOL 2014 standard, it is still essentially the same primarily transaction-oriented language, while adding support for structured, procedural and object-oriented programming styles. Deriving most of its core from Admiral Grace Hopper‘s FLOW-MATIC  language, it allows for efficiently describing business logic as one would encounter at financial institutions or businesses, in clear English.

Unlike the older GnuCOBOL project – which translates COBOL to C – the new GCC-COBOL front-end project does away with  that intermediate step, and directly compiles COBOL source code into binary code. All of which may raise the question of why an entire man-year was invested in this effort for a language which has been declared ‘dead’ for  probably at least half its 63-year existence.

Does it make sense to learn or even use COBOL today? Do we need a new COBOL compiler?

Continue reading “Making The Case For COBOL”

Auditory Brainstem Implants: The Other Bionic Hearing Device

You might have heard of the cochlear implant. It’s an electronic device also referred to as a neuroprosthesis, serving as a bionic replacement for the human ear. These implants have brought an improved sense of hearing to hundreds of thousands around the world.

However, the cochlear implant isn’t the only game in town. The auditory brain stem implant is another device that promises to bring a sense of sound to those without it, albeit by a different route.

Continue reading “Auditory Brainstem Implants: The Other Bionic Hearing Device”

The Joy Of Broadcast Media Vs. The Paradox Of Choice

The rise of streaming services on the Internet was a revolutionary shift when it came to the world of media. No more would content be pumped in to homes in a one-way fashion, broadcast by major conglomerates and government-run organizations. Instead, individuals would be free to hunt for content suiting their own desires on an all-you-can-watch basis.

It’s led to a paradigm shift in the way we consume media. However, it’s also led to immense frustration thanks to the overwhelming amount of content on offer.  Let’s take a look at why that is, and some creative ways you can get around the problem.

The Paradox of Choice

Many find the masses of content on streaming services to be overwhelming to choose from. Credit: author screenshot

Traditionally, when it came to media, there were two major arms of delivery: broadcast, and home media. One might listen to the radio, or flick on the TV, or alternatively, spin up a record, or select a movie to watch on tape. If none of those options  sufficed, one might take a walk down to the local video store to rent something more appealing.

Fundamentally, it was an era in which choices were limited. There were a handful of TV stations to choose from, and if nothing good was on, you could go as far as finding something watchable on tape or going without. Many will remember afternoons and evenings spent watching reruns or a Friday night movie that had been on a million times before. Some shows went as far as becoming legends for their seemingly endless replay, from The Simpsons to M*A*S*H. 

As the Internet grew, though, the game started to change. Torrent websites and streaming services came along, offering up the sum total of the world’s cultural output for free, or for a nominal cost for those averse to piracy. Suddenly when it came to choosing a movie to watch, one wasn’t limited to the five or so films on at the local cinema, nor what was left on the shelves at the local video rental. Instead, virtually any movie, from the invention of the format, could be yours to watch at a moment’s notice.

With so many options on the table, many of us find it harder to choose. It’s an idea popularly known as the Paradox of Choice, a term popularized by US psychologist Barry Schwartz in 2004. When our options are limited to a select few, choice is easy. They can quickly be compared and ranked and an ideal option chosen.

Add thousands of choices to the pile, and the job escalates in complexity to the point of becoming overwhelming. With so many different choices to contrast and compare, finding the mythical right choice becomes practically impossible. Continue reading “The Joy Of Broadcast Media Vs. The Paradox Of Choice”

Handling Bulk Material: Why Does My Cat Food Get Stuck?

Bulk material is stuff handled ‘in bulk’. One LEGO piece is a brick but 1,000 poured into a bag is bulk material. Corn starch, sand, flour, powder-coat powder, gravel, cat food, Cap’n Crunch, coins, screws, Styrofoam beads, lead shot, and gummy worms are bulk materials.

Applications abound where you need to move stuff in bulk. Selective sintering 3D printers, animal feeders, DIY injection molders, toner based PCB makers, home powder coating, automatic LEGO/domino/whatever sorters or assemblers, automated gardeners, airsoft accessories – handling bulk material is part of hacking. College science classes cover solids and liquids, but rarely bulk materials.

Most hackers just pray it works and tap the bin when it doesn’t. Industry does better, but the slang term “bin rash”, the long term result of tapping a 300 ton bin with sledgehammers (video),  shows they don’t get it right all the time either. At the same time, it’s a fun area you can experiment with using kitchen items. So come along with us for a short series on the basics of bulk material handling. Continue reading “Handling Bulk Material: Why Does My Cat Food Get Stuck?”

Natural Language AI In Your Next Project? It’s Easier Than You Think

Want your next project to trash talk? Dynamically rewrite boring log messages as sci-fi technobabble? Happily (or grudgingly) answer questions? Doing that sort of thing and more can be done with OpenAI’s GPT-3, a natural language prediction model with an API that is probably a lot easier to use than you might think.

In fact, if you have basic Python coding skills, or even just the ability to craft a curl statement, you have just about everything you need to add this ability to your next project. It’s not free in the long run, although initial use is free on signup, but for personal projects the costs will be very small.

Basic Concepts

OpenAI has an API that provides access to GPT-3, a machine learning model with the ability to perform just about any task that involves understanding or generating natural-sounding language.

OpenAI provides some excellent documentation as well as a web tool through which one can experiment interactively. First, however, one must create an account and receive an API key. After that is done, the doors are open.

Creating an account also gives one a number of free credits that can be used to experiment with ideas. Once the free trial is used up or expires, using the API will cost money. How much? Not a lot, frankly. Everything sent to (and received from) the API is broken into tokens, and pricing is from $0.0008 to $0.06 per thousand tokens. A thousand tokens is roughly 750 words, so small projects are really not a big financial commitment. My free trial came with 18 USD of credits, of which I have so far barely managed to spend 5%.

Let’s take a closer look at how it works, and what can be done with it!

Continue reading “Natural Language AI In Your Next Project? It’s Easier Than You Think”