THREAD: Imagine Python aspiring to be all that it could be... ๐ฅฐ What would it look like?
All of this is well-tested code you can use in your projects today by importing from ๐๐๐๐๐๐๐๐ by @fastdotai.
๐๐๐๐๐๐๐๐ can make your code cleaner and easier to maintain...
2/ We will go through the functionality in the order it is defined in ๐๐๐๐๐๐๐๐.
Let's start with __๐๐๐๐__
Tired of its output containing very little information useful to a human being?
Here is what you can use instead!
3/ Need to chunk that list into multiple sublists? Maybe you are attempting to run calculations in parallel or doing something even more tricky?
No need to look for that stackoverflow post ever again ๐
The functionality that you need is right here!
4/ How about a dict that you can access without those pesky brackets?
5/ And for all your casting needs...
This example is trivial, but just imagine how much more concise and easy to read your code could be if you could use type annotations in this additional way!
6/ ๐๐๐๐๐_๐๐๐๐ ๐ฅฐ Dataclasses that do not introduce new syntax + that allow you to define your own init!
7/ Composition plays an important role in OOP, but how do we make it play nice? ๐ค How do we compose our objects to our heart's desire and still deliver a nice UX?
8/ TIL Python only started to have a construct for merging dicts in 3.5!
๐๐๐๐๐๐๐๐'s merge gets an honorable mention here (works across multiple dicts)
8/ The functions that follow are tiny but can be super useful for so many things ๐ฅฐ.
9/ ๐๐๐๐๐๐๐๐ - a whole new, awesome, take on the tuple
(this is a screenshot of a notebook where this functionality is defined)
10/ ๐๐๐๐๐๐๐ but where you can move the arguments around, yesss!!!
(tiny example followed by a screenshot of the NB)
11/ Patching... in a language that does not allow for reopening a class, this is badly needed!
I want my tools to allow me to wield great power so that I can direct it at will. I do not want a 'dumbed down' API just because I can misuse it if I code without care...
12/ Runtime type validation!
This covers just ๐๐๐๐๐๐๐๐.๐๐๐๐๐๐ - more to come! ๐
โข โข โข
Missing some Tweet in this thread? You can try to
force a refresh
If you do decide to follow through with this approach, you are opening yourself up to a world of hurt ๐
But with time, this will allow you to work on your computer faster and in an (IMHO) much more pleasant way.
Here is a teaser (I am not using the mouse for any of this).
Quick howto:
โ alt-d and start typing to start a program
โ alt-enter opens terminal
โ ctrl-f c creates a new tmux pane
โ ctrl-f x closes current pane
โ ctrl-f n, ctrl-f p, ctrl-f <pane num> switches between panes
โ shift-alt q closes current program
THREAD: Can you start learning cutting-edge deep learning without specialized hardware? ๐ค
In this thread, we will train an advanced Computer Vision model on a challenging dataset. ๐๐ Training completes in 25 minutes on my 3yrs old Ryzen 5 CPU.
Let me show you how...
2/ We will train on the challenging Oxford-IIIT Pet Dataset.
It consists of 37 classes, with very few examples (around 200) per class. These breeds are hard to tell apart for machines and humans alike!
Such problems are called fine-grained image classification tasks.
3/ These are all the lines of code that we will need!
Our model trains to a very good accuracy of 92%! This is across 37 classes!
How many people do you know who would be as good at telling dog and cat breeds apart?
2/ In 2016 Sarada founded the Perth ML Group to help others learn.
How can the community support you? ๐ค
It can...
โ help you set up your environments ๐งโ๐ป
โ provide technically-sound answers to challenging questions ๐ก
โ make learning more fun! ๐ฅณ
3/ What are some tips for community participation?
โ explaining things to others will help you learn ๐ฆ
โ it's okay to be anxious about sharing your answers publicly - DMs are always an option ๐จ
โ experiment with various approaches and learn in a way that suits you best ๐ก