Skip to main content

Weights and Biases Edge Impulse Custom Block

Using Weights and Biases to train, track and tune for true Tiny ML
Created on September 13|Last edited on December 15


How small is Tiny?

Enter the Micro Controller

Presently there are a growing number of edge applications such that are typically similar that devices such as Nvidia Jetson, or mobile phones.
Edge Impulse enabled users to connect to edge devices and weights and biases can be installed on any device that can have an operating system. There are devices however known as microcontrollers that have much more limited constraints, these devices typically have ram in the order of kilobytes and pre-compiled models and programs.

These devices cannot have full python and generally run best on C++ compiled binaries. Edge impulse has developed methods for codeless deployment and conducting data pre-processing pipeline in UI and deploying straight to the device, massively speeding up the deployment cycle and reducing the threshold of specialist knowledge.
These devices can perform inference quickly and consume extremely small amounts of energy, running for several months on small batteries. This is a very different set of constraints to optimize for, where model size, inference time, and power draw are paramount.

Data Pipeline

  1. Get data into Edge Impulse;
  2. Implement pre processing step and create embeddings in Edge Impulse
  3. Create test train split Edge Impulse UI;
  4. Download data;
  5. Log Artifact;
  6. Log table with media and meta-data;


Setup

  1. Setup wandb and EI accounts - You need an EI and W&B accounts to set up the connectivity.
  2. Install EI CLI
Use the following command to install EI CLI
npm install -g edge-impulse-cli
3. Pull the Data from EI
edge-impulse-blocks runner --download-data
4. Select "Weights & Biases / Bird sound classifier custom ML"
$ mkdir -p data && mv ei-block-data/*/*.npy data/


First steps:

  1. Set up WandBa and EI account:
  2. Install CLI:


$ edge-impulse-blocks runner --download-data
Install EI CLI to pull data and upload as WandB Artefact which can then be used in training, starting by installing EI's CLI:

npm install -g edge-impulse-cli
To get initial data (the calls below this section to update are not live yet):


# Select "Weights & Biases / Bird sound classifier custom ML"

$ mkdir -p data && mv ei-block-data/*/*.npy data/

Training

  1. Train single run (WandB EI Custom Block)
  2. train sweep
  3. get the best model from the parameter search

Evaluation

Push Edge Impuls



Pushing to Edge Impulse

/