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/
But what if I have metadata? Won't that all get destroyed?
In the cast, the metadata itself is maintained inside the tensor, as seen below, BUT 4/
When interacting two tensors of the same type, the metadata is only kept in the first tensor of the operation. Such as below 5/
Finally we looked at the LossMetrics class. What this allows you to do is take a complex loss function that perhaps has multiple losses at once, and allows you to report them as a part of your metrics. A basic example taken from the @fastdotai is shown below 6/:
To use simply make sure that each loss is stored away as an *attribute* in your overall loss function, and then pass in a comma-separated string of each attribute into LossMetrics 7/
Finally, to return back to the TensorBase stuff, why is it some loss functions will just *work* when using say cnn_learner? And you don't need to do that big conversion?
fastai has a `Flatten` layer which is added on top, which internally casts to a TensorBase 8/
As an added bonus, if you write a loss function inheriting `BaseLoss`, it will perform this for you, just pass in the original loss function to it
Hope this has helped alleviate some more @fastdotai mysteries and solved a bug here or there!
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/
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!
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)
At the end of the day, it's not about who copied who. It's about taking and using the ideas of some other library (which also is published paper), without giving the proper attribution in your GitHub or documentation, which gets the most traffic. 1/7
And don't even *try* to claim to do something revolutionary, when in reality it's something others have taken months and years to build, and you’re simply taking notes (or more). 2/7
Open source frameworks and the evolution of these libraries build upon each other. That’s the definition of a community. You look at what’s being used, where their weakness are, their strengths, and you start tweaking. 3/7
Today I’ve come across some wonderful @fastdotai YouTube channels with some excellent content! Below is a thread of my findings for folks to check out (I’ve subscribed to them all!) 1/
First and foremost we have the wonderful work coming out of @ai_fast_track. Along with the #IceVision videos he’s also done quite a number of videos exploring the @fastdotai API with some EXCELLENT videos, I’m certainly taking notes youtube.com/channel/UCht9j…
Next we have some videos by @philwhln. His first two short videos on #fastbook show some great insights into dealing with issues he had, and a great overview of the first few chapters 2/ youtube.com/user/philwhln
The first introduces the library and quickly examines what's new, a perfect start for beginners and experts alike. We will cover just what @fastdotai is, how its used, and the goal of the library: muellerzr.github.io/fastblog/2020/… 2/6
The second assumes that you are familair with the original library (@fastdotai v1). We'll compare 1:1 examples of the API, go deep into the High-Level API, and discuss what some of the best new tricks are: muellerzr.github.io/fastblog/2020/… 3/6