To start with Audio classification, the easiest way is with Google's Teachable Machine: teachablemachine.withgoogle.com

You won't need any expertise, just add some audio samples and you'll have a model

Let's take a quick look on the basics and some internals

#teachablemachine

1/8🧵
You can gather the data right in the the tool:

There are some great tips on how to gather better data here 🗣️🎙️:
teachablemachine.withgoogle.com/faq#Tweaking-y…

2/8🧵
Some tips are 💡:

-> To improve the quality of your audio data, try recording it with different microphones, in different rooms, changing the proximity to the mic.
-> The model will learn from 1-second samples so it won't be able to recognize longer events.

3/8🧵
After you have some data to train a model, you can define the number of epochs and start training your model

The training runs completely in the Browser using TensorFlow.js

Your data doesn't go to any server unless you choose to save it to your Google Drive

#MadeWithTFJS
4/8🧵
With the model trained you can Export it and/or just play with it on the browser

Export your model:

Here you can define an Overlap Factor, which means how frequently the last second of audio is classified by the model

5/8🧵
You can export the model to run on the Browser with TensorFlow.js or on a mobile device with TensorFlow Lite.

They even give you all the source code you'll need.

For the full code to run on Android, you can check out this repository: github.com/tensorflow/exa…

6/8🧵
For Audio, the model is built using the Speech Command Recognizer sample (github.com/tensorflow/tfj…)

Would you like a more detailed view on this sample specifically?

7/8🧵
All the source code for Teachable Machine is available here: github.com/googlecreative…

Teachable Machine is a great start!

But what would you do if you need a more robust base model? or have a big dataset?

I'll answer this questions later, stay tuned! 👀

8/8🧵

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Luiz GUStavo 💉💉🎉

Luiz GUStavo 💉💉🎉 Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @gusthema

24 Jun
One term that I learned when I started studying ML is Hyperparameter.

What is it?
When should I worry about it?

Let me try to clarify it...

[3 min]

1/9🧵
First, what are the parameters of a ML model?

Those are typically the weights that you end up with after training your model. Example:

If you are creating a model to solve
AX + B = Y

A and B are the parameters you'll find. They are also know as the weights of the model

2/9🧵
Hyperparameters are the values that control the learning process.
Let's suppose we have the code in the image.

Hyperparameters could be: unit (from the Dense layer), learning_rate from the optimizer or even the batch_size

3/9🧵 Image
Read 9 tweets
18 Jun
This week I've been posting about the itertools Python🐍 module.

If you want to improve your coding skills, one way is adding new tools to your toolbox

Itertools enables you to solve problems that would otherwise be absurdly hard to solve.

[2min]

1/7🧵
After you've learned the basic of Python, I'd suggest you go deeper in the collections manipulation:

• Slicing
• Comprehension
• Generators
• Iterators
• Itertools
• map/filter/zip

I've posted about all this content in the past, I can revisit if you'd like

2/7🧵
This week I've explained all functions on the itertools module

Starting by the basic ones:

3/7🧵
Read 7 tweets
17 Jun
Generating combinations and permutations is usually a tricky task in programming.

In Python 🐍, using the itertools library this becomes much easier, less memory intensive and faster!

Let me tell you what I learned with them

[4.45 min]

1/13🧵
Let's suppose you want to create all possible cards of a regular deck. What you have to do is to join:

• All cards ranks: A, 2 to 10, J, Q and K
• The 4 suits: ♥️♣️♦️♠️

How to generate all cards?

2/13🧵
The operation that can solve this is a cartesian product:

ranks = ['A'] + list(range(2, 11)) + ['J', 'Q', 'K']
suits = ['♥️', '♣️', '♦️', '♠️']

all_cards = it.product(suits, ranks)
>>> ('A', '♥️'),('A', '♣️'),('A', '♦️'),('A', '♠️'),...
len(all_cards)
>>> 52

3/13🧵
Read 13 tweets
15 Jun
Following up from my previous thread, let's continue taking a look at some additional itertools methods

Some of them, as you will see, have very similar built-in versions but the key here is: itertools works on iterables and generators that are lazy evaluated collections

1/14🧵
One example is the method islice. It does slicing but for iterables (potentially endless collections). The main difference is that it doesn't accept negative indexes like regular slicing.

numbers = range(10)
items = it.islice(numbers, 2, 4)
>>> [2, 3]

2/14🧵
zip_longest vs zip
both do the same thing: aggregates elements from multiple iterators.

The difference is that zip_longest aggregates until the longest iterator ends while zip stops on the shortest one.

It will fill the missing values with any value you want

3/14🧵
Read 14 tweets
9 Jun
Quick⚡️ Python🐍 trick:
How do you merge two dictionaries?

[55 sec]🤯

1/6🧵
For Python 3.5 and up you can do:

d1 = {"a":1, "b":2}
d2 = {"c":3, "d":4}
d3 = {**d1, **d2}
d3 == {"a": 1, "b": 2, "c":3, "d":4}

Why?

2/6🧵
The ** operator expands the collection, so, you can think it as this:

d1 = {"a":1, "b":2}
d2 = {"c":3, "d":4}
d3 = {**d1, **d2} -> {"a":1, "b":2, "c":3, "d":4}
d3 == {"a": 1, "b": 2, "c":3, "d":4}

3/6🧵
Read 6 tweets
8 Jun
I was telling a friend that one cool feature from Python is list slice notation

So instead of just posting the link I decided to do a brief explanation.

[5 min]

Python's regular array indexing as in multiple languages is: a[index]

a = [0, 1, 2, 3, 4]
a[0] == 0

1/12🧵
Python has negative indexing too:

a = [0, 1, 2, 3, 4]
a[-1] == 4
a[-2] == 3

2/12🧵
Python also enables creating sub-lists from a list, or a slice:

-> a[start_index:last_index]

a = [0, 1, 2, 3, 4]
a[1:3] == [1, 2]

start_index is inclusive
last_index is exclusive

3/12🧵
Read 12 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!

:(