Quiz Time!

Can anyone tell me the difference between this @fastdotai code? How does it behave differently:
Answer: There isn't!

One is more "verbose" in my opinion (get_x and get_y), but neither lose any flexibility as you use it.

2/
But what if I have three "blocks"? Don't I need to use `getters` for that?

Not necessarily. Since we can declare an `n_inp` (as seen below), we can simply load in our `get_x` or `get_y` with multiple functions to be utilized instead for those types:
So in conclusion:

Use what's most readable to you, and makes the most sense.

You can either use getters and have it all in one place, or be a bit more clear about what's x and what's y and use `get_x` and `get_y`.

The choice is yours!
How we read this here is:

The first `get_y` equation gets applied to BBoxBlock, and the second to BBoxLabelBlock

• • •

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

Keep Current with Zach Mueller

Zach Mueller 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 @TheZachMueller

8 Apr
A list of the best (and partially biased) @fastdotai resources, in no particular order, with descriptions and how I utilize them 🙂

(A thread)
docs.fast.ai paired with their source notebooks in github.com/fastai/fastai/….

Looking from documentation to examples right away, and letting yourself get your hands dirty. The most common notebooks I go back to ...
nb50, DataBlock: docs.fast.ai/tutorial.datab…

Shows a variety of ways to create @fastdotai DataBlock and DataLoaders with the midlevel API

Callback (Core): docs.fast.ai/callback.core.…

Remembering the event trigger names, how they work, and quick links to other examples

...
Read 13 tweets
6 Apr
lib2nbdev has been on my mind for months now, and finally it exists! What's the biggest struggle with @fastdotai's #nbdev? Using it on existing projects. This tool aims to fix that.

But how does it work?

novetta.github.io/lib2nbdev/
With a simple bash command: `convert_lib`.

You are then guided through the process of setting up nbdev's `setting.ini` file and afterwards all of your existing code will be converted directly into fully functional notebooks! Image
But wait, don't you just throw it all into one big cell?

NO! Instead lib2nbdev will determine what should be private or public, what's an import, and what particular cell tag it should be generated with, such as below which has both private and public tags: Image
Read 8 tweets
27 Feb
Thanks everyone for joining me on this much more brief stream, in this thread I'll try and summarize all we discussed including:

- x is not implemented for y
- LossMetrics
- TensorBase and tensor metadata

And here is the stream:

1/
.@fastdotai had utilized their own tensor subclassing system in v2, however originally there weren't many issues as fastai just "let" you do things with these classes. Then @PyTorch came along and introduced them in 1.7. Suddenly, people were getting this! Why?
Pytorch became much more explicit in what subclasses can interact with oneanother. As a result @fastdotai had to make the TensorBase class which allows for any tensor-types to interact with each other. A quick function to convert and an example are below 3/
Read 11 tweets
20 Feb
Thank you all SO much for joining me tonight, it was a ton of fun to be back in the streaming/teaching wheelhouse again! We had almost 300 people chime in! For those that missed out, the video link is here:
1/
The notebooks are also available here, and eventually I'll have them fully integrated into walkwithfastai.com, just need to figure out a good way first! 2/ github.com/walkwithfastai…
From what I gathered from the feedback, it seems this stream really did help open up everyone's eyes to the power of @fastdotai's Callback system, and how it's training loop works. It's not just a marketing phrase when they say you can modify ~everything~ in the training loop! 3/
Read 5 tweets
18 Feb
Have you wanted to know just what goes on in @fastdotai's training loop and just what those pesky Callbacks are up to? In the latest release of Walk with @fastdotai this is now possible!

walkwithfastai.com/basics.trainin…

1/ Image
What we've done here is extended fastai's existing `show_training_loop` functionality to include some information (from a provided doc string) of what exactly is occurring during each event. This then lets you get more familiar with what fastai's training loop, ... 2/
Understand when things are called, and what happens at each step. The old version (which is still there if you pass `verbose=False`) simply just showed what Callbacks were triggered (pictured below) Image
Read 5 tweets
14 Feb
🎉🎉New Blog Alert!🎉🎉

Come learn how to integrate your @PyTorch into @fastdotai with the most minimal fastai possible!

What does this entail?

- Pytorch Datasets
- Pytorch DataLoaders
- Pytorch Models

But, is it really so easy as advertized?

muellerzr.github.io/fastblog/2021/…
Let's find out. In total, this article used four @fastdotai imports to have full access to the training loop and pretty fit outputs:

Optimizer, DataLoaders, Learner, and ProgressCallback Image
From there, it's really just as simple as passing it all to `Learner` and having it go from there! Image
Read 8 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!