Gus (🤖🧠+🐍+🥑🗣️) Profile picture
AI Developer Advocate @google - Gemma 💎 - Machine Learning 🤖🧠 - Google AI ⚙️🧠 - DevRel 🥑🗣️ find me also at: https://t.co/3nrTwEKoJ0
Mar 14, 2023 13 tweets 3 min read
Ok, since today is Pi (π) day, maybe it's a good day to learn about it a little bit!

Here are some fun facts about the number Pi
🤓

👇 Pi is the ratio of a circle's circumference to its diameter.

It is an irrational number, meaning it cannot be expressed as the ratio of two integers.

And its digits NEVER repeat in a regular pattern.

👇
Mar 13, 2023 8 tweets 3 min read
Learning how to apply Machine Learning for the Audio domain can be tricky as there are aspects related to the data that might not be obvious and it's not as popular of a topic as Image or Text

Don't worry! I got you covered!

Here are some tutorials to get you started:

👇 The first one you should take a look at is the Recognizing Keywords tutorial:

tensorflow.org/tutorials/audi…

This tutorial goes over some of the basics and it's a great start

👇
Mar 8, 2023 15 tweets 7 min read
🐦🦅🦆🦉🦜+ 🤖🧠 = 💰

I've been working with ML for the Audio domain for a while

At first I couldn't understand much but as I kept reading I managed to figure out some things.

Let me share some of the basic theory with you:
🎙️🧑‍🏫

👇 Sound is a vibration that propagates as an acoustic wave.

It has some properties:
• Frequency
• Amplitude
• Speed
• Direction

For us, Frequency and Amplitude are the important features.

en.wikipedia.org/wiki/Sound#Sou…

👇
Sep 12, 2022 9 tweets 2 min read
"How do I learn Python?"
🤔

3 tips:

• Do one basic tutorial 🤓
• Practice, practice, practice 💪🏾
• Start/Find a project to apply what you learned 🧐

"Ok Gus, how about some links?"

👇 I have three very good Python tutorials to get you started:

1⃣ Kaggle course: kaggle.com/learn/python

• Kaggle Kernels allow you to try the code in the browser
• Very good pace of content
• Fun and challenging puzzles

👇
Aug 29, 2022 9 tweets 2 min read
When we talk about Decision Trees in Machine Learning, one of the most popular and powerful algorithms is the Gradient Boosted Decision Trees

Do you know how it works?🤔

Let me give you an easy explanation of how it works…👀

👇 Gradient Boosted Decision Trees (GBDT) is an ensemble method -> it's based on a set of other smaller models

The smaller models are just Simple Decision trees, similar to the Random Forest algorithm

👇
Jul 28, 2022 5 tweets 1 min read
What are Python🐍 decorators🎀?

Decorator is an Object Oriented pattern that allows behavior to be added to individual objects

They can be more efficient than subclassing and in some cases it can make your code 1000 faster!👀🤯

👇 Python supports this pattern and you can apply decorators to functions like this:

@some_decorator
def my_function():
Some_code

This is also called metaprogramming.

👇
Jul 7, 2022 8 tweets 3 min read
A good programmer knows when to be lazy!
🦥

This is so true that Python🐍 has a specific keyword to help you being lazy:

➡️yield

Let me explain:
• why it's important
• what's a Generator and iterable
• when you should just be lazy!

🧵 An object is called iterable when you can traverse all its elements. Some common examples are lists, dictionaries or sets.

🧵 Image
Jun 1, 2022 6 tweets 2 min read
Four Python🐍 Libraries 🛠️to help you on your day to day

(non ML related edition ⛔️🤖)

👇🏾 1⃣Requests

Simple and elegant HTTP lib
that enables you to download things, navigate pages, keep sessions and many other features!

It’s better than urllib because:
• Automatically decode response into Unicode
• Easier api
• Better error handling

pypi.org/project/reques…

👇🏾
May 29, 2022 7 tweets 3 min read
Five websites to learn Python🐍 that you will want to bookmark and start your journey today

👇🏾👇🏾👇🏾 1⃣Colab -> colab.sandbox.google.com

It's a web based development env
Your code will run on a free VM and have most of the popular dependencies pre-installed for you

No need to worry about preparing your machine or installing anything, making your start way easier!

👇🏾
May 17, 2022 9 tweets 3 min read
5 links to help you start (or continue) your Machine Learning journey

👇 1⃣ Colab

One thing that people will tell you: "to do ML you need a beefy machine"

That’s partially true, but as a start you don’t need to spend any money to learn!

Just use Colab and have access to GPUs and TPUs for free!

This is the perfect learning environment for me

👇
May 16, 2022 5 tweets 3 min read
Python🐍 is amazing and the builtin dict collection has a powerful feature

Problem: count the number of times words are in a text

Simple solution: verify if the word is already present in the dic, increment, if not, adds the default value.

This is ugly, let's do it better

👇 This is so common that Python has a better way of doing it!

The get(key, default) method on dict class

You can define a default value and that's easier to read and maintain

docs.python.org/3/library/stdt…

but...

👇
Jan 15, 2022 7 tweets 4 min read
Yesterday I posted the puzzle🧩 below

It was a great experience for me as I learned from it maybe as much as everyone that tried to solve the problem themselves!

Here is what I learned:

1/7🧵 The same 🧩 can be updated to have🕊️|✈️|🚁
Those would be 1's but not contiguous

Thanks @sebabenz, @MSex and @treyhunner for this!

Eg:
[[1,0,0,1],
[0,1,0,0],
[0,1,1,0],
[1,1,1,1]]

The highest building is still of height 3
Would you be able to solve this new version?

2/7🧵
Jan 11, 2022 12 tweets 3 min read
When you use environments like Google Colab, Jupyter Notebooks or Kaggle Kernels, you have access to Magic Commands🪄

Let me explain how they work⚙️,
why they matter🤔
and how to create one yourself🏗️

[1 min]

1/12🧵 When you use Colab, Kaggle Kernels and Jupyter Notebooks you are using a web interface to an interpreter called: IPython

IPython is a command shell for interactive computing created in 2001 by @fperez_org

2/12🧵
Jan 10, 2022 5 tweets 1 min read
How deep do you need to understand Machine Learning to start using it?🤔

Let's use an analogy to explain this

Imagine 3 personas:
• 🧑🏾‍✈️Driver
• 👩🏾‍🔧Mechanic
• 👩🏾‍🔬Car Manufacturer

[1 minute]

1/5🧵 🧑🏾‍✈️

To drive a car you need to study and learn the rules on how to operate it safely but you don't need to know how the engine works

To use a ML model, you read the docs, the limitations and then try it. There's no immediate need to know it's internals

2/5🧵
Jan 7, 2022 7 tweets 2 min read
Have you ever thought about what a Neural Network tries to do? 🤔

Why does it work? 🤔

Let's try to understand visually 👁️🔎
(🚨 no heavy math)

1/7🧵 Imagine two sheets of paper, with the same color but with a number written on them: 1 and 2. 📜📜

Put one over the other and crumple them into a ball🏐

Now, can you create a function that looking at parts of your paper ball can tell you from which sheet of paper it is?🤔

2/7🧵
Jan 6, 2022 4 tweets 1 min read
💡Machine Learning🤖🧠 models are designed to make predictions and not giving you insights.

If you have a bunch of data and want to find out "interesting" things about it, use Statistical approaches!

[20 seconds]👀

1/4🧵 Try to go further and use ML to make decisions, not just predictions!

Make sure your predictions allow you or your users to take useful action.

That's when your user will have a magical moment

2/4🧵
Jan 5, 2022 11 tweets 3 min read
The main reason why Python🐍 is so popular with Machine Learning🤖🧠 developers is because it's so easy to read.👓

But another feature that really helps is the collections manipulation tools, specifically Slicing!🔪

Let me show you how it works
👇🏾👇🏾👇🏾

[2 min]

1/11🧵 Python's array indexing works the the same as in many languages: a[index]

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

-> index can be negative too:🤯

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

2/11🧵
Jan 4, 2022 7 tweets 5 min read
New year and you want to start your Machine Learning 🤖🧠 journey

Here are the 3 things you'll need to start:

1⃣ - A good ML Tutorial/Course
2⃣ - An environment to code
3⃣ - The Secret sauce

Let me give you some directions🎯

[1 minute]

1/7🧵 1⃣ -> There's a lot of free content with great quality available.

To start, I usually recommend this free ML Crash Course:
developers.google.com/machine-learni…

It goes from the basic level all the way to advanced topics!

2/7🧵
Jan 3, 2022 5 tweets 2 min read
When you start with Machine Learning, some of the first challenges that you'll face are:

- Install all the required dependencies👷🏾‍♂️
- Have a good enough machine to train models💸
- Enable the GPU since ML can be very compute-intensive😰

My solution is…

1/5🧵 My solution is to use Colab: colab.research.google.com

Colab is a hosted Jupyter notebook stored on Google Drive and can be shared just as any Drive file

It allows you to write and run Python🐍 code on the browser

It requires NO SETUP🤩 and provides FREE🤯 access to GPUs

2/5🧵
Jan 2, 2022 6 tweets 2 min read
Around 2010, I got a job interview for one of the biggest banks in Brazil.

The Interviewer🧐 gave me a test (I aced it) and asked a lot of technical questions of course.

He also asked for my school grades (?!)🤔🤨
(at that point, grades were 10 years old...)

[1 minute]

1/6🧵 🧐: You weren't such a brilliant student, right?
Narrator🎙️: he wasn't
Me🧑🏾‍🦱: Yes, I wasn't. My grades before my Masters weren't great.
🧐: Since we are so big we choose to hire only the best to work here.
🎙️: that's BS...🐂💩

2/6🧵
Dec 7, 2021 5 tweets 2 min read
Have you ever wanted to run a query on your NumPy array?

Like:
• where are the numbers smaller than 0?
• How many numbers are positive?
🤔

NumPy has the where method for exactly that!
🤩👍🏾

[1 min]⚡️

1/5🧵 #Python The where method receives:
• condition (a < 0)
• Operation if cond is True (x)
• The "else" operation (y)

You only need the condition, the rest is optional*

2/5🧵