For the object verification problem with new category I have posted last time, I change the technique used from binarizing the last layer to multi variate gaussian anomaly detection and the results is so much better. I have written it here: Object verification with new category added to model
The idea is we can based on the statistic of the features vector to calculate the probability of matching object. The multivariate gaussian anomaly detection is introduced in Andrew Ng course and summarized here: gaussian anomaly detection . I have changed a little bit from the original algorithms that I calculate the logarithm of probability because with high number of variables (128), the results can be too big or too small. Ex: Ex: 48 variables with 0.1 probability for each. The multivariate probability is 0.1⁴⁸ — Very small number
The histogram of probability of number 7 (which have the worst result from last time) and number 9 are below:
Number 7
The probability of number 9 is much higher than number 7 this time. (I don’t know why the probability calculated by multivariate_normal . pdf in python > 1 , but I think the concept is the same so it is not a big deal)
p/s: I haven’t tried the auto-encoder yet. I still think that the classification training will create a better feature vector to differentiate different object
I trained a Language Model for arabic on a subset of sentences (I think 100000) from Wikipedia dump. the total dump is around 5GB, I trained on one file of 160MB, I couldn’t do more as even such small dataset collab kernel was on the edge! Also even with such small dataset the training took 3h!!
Unfortunately, the dataset is highly biased. I used the default data augmentation settings + vertical flipping to mitigate these issues. More work can be done here.
nv 67%
mel 11%
bkl 11%
bcc 5%
Other (3) 6%
get_transforms(flip_vert=True)
I had it train overnight (roughly 7 hours) on resnet-50.
I’ve been reading the fastai library source code during my Thanksgiving trip both in the old school way (a decent-sized printout) and using VScode to navigate it. As a minor project I decided to visualize the key dependencies in a simplified way, and I’ve found the output helpful:
I built a language model on 26 works of fiction from Project Gutenberg. Here’s the notebook.
To train the model, I used paragraphs of text as observational units. Then I looked at how well the model was able to determine which work of fiction each of the paragraphs in the validation set belonged to. There was some class imbalance, so the final accuracy score of 71% may be a bit misleading. But looking at the confusion matrix, it does seem like the model performs well above chance, even for under-represented texts. The model’s most frequent source of error was due to misattribution of a different text written by the same author (e.g. one Charles Dickens book sounds a lot like another).
Two handy coding tips I learned:
plot_confusion_matrix() creates a plt object which can be manipulated directly (for relabeling ticks and axes, for example). This is nice because the method itself doesn’t return a Pyplot object - but once you know that the plt space is currently representing the confusion matrix plot, you can adjust it as needed.
The ClassificationInterpretation class in fastai.vision (which includes most_confused, plot_confusion_matrix, etc) can be used for text classifiers, too. Super handy.
^ Apologies if those were already noted in class, I’m a bit behind on my lectures.
I wrote a blogpost about the inner workings of CNN. My aim is to put together a post series that guides the reader through the network - from an input image to the parameter optimisation - and thereby providing a introductory resource for those not familiar with the maths behind CNN yet. In doing so, the goal is to be as comprehensive as possible on the one hand and concise on the other.
The post is the first part in the planned series. And there will be more to come in the coming days and weeks.
As I started dealing with CNN and deep learning in general a few months ago, I’m sure there is room for improvement and I would be more than happy to get feedback.
For gaming enthusiasts, I decided to tackle on a nice kaggle dataset called 20 Years of Games. Using the techniques used in the ‘rossman’, which we will learn next week, I hope to improve these results.
Since the process was interesting, I’ve written the following short Medium post describing the details of the process.
The accompanying notebook can be found at this gist.
Green part shows where the model reacted positively for a particular class and red highlights parts where it reacted negatively.
Here is the video from authors explaining the intuition behind the technique. You can find the notebook here.
If you find any mistakes or have suggestions, feel free!
I am quite late into this arena. Have used my learning from fast.ai courses and able get rank within top 100 into the competition. I have used resent model, adaptive learning and unfreezing of selective layers. Still working on this to get into top 10…
I am slowly catching up with the rest of the class. I am still on Lesson 2.
I combined Pankaj Mathur’s very nice web app layout and Simon Willison’sidea of also including the option of adding URLs and did a black/grizzly/teddy finder app.
Together with @r0mer0m we wrote an intuitive guide to understand the BERT architecture (based on the Transformer) which has recently achieved SOTA in various NLP tasks. We appreciate your feedback in how to make it as clear and straightforward as possible.