Deep Learning For Coders
(with fastai & pytorch)
- Skimming notes
- Read backwards next time, the last few chapters are the most interesting
- Particularly RNN, CNN, Batch normalization, etc.
- Look for "*" highlights to find interesting papers tha I should read and are relevant
- Debugging tools including CAM, different activation visualizations, particularly
- visualizing loss landscape
- colorful dimension, stefano giomo
- I know terms more intuitively now, but still can't visualize / code it up from scratch
- Implement papers and other programs in pytorch
- Pytorch hooks should be fantastic for building additional debugging tools
- Deep learning is fairly massive, but what's valuable depends on what I'm working on
- Instead of trying to absorb the world, I'm much better of focusing on real problems
- and finding techniques to solve them
- Which means keeping up with shallow literature surveys
- with spikes that are tentatively important and pass my bullshit filter
- instead of breathlessly trying to capture and learn everything.
- Read backwards next time, the last few chapters are the most interesting
- Notes
- Chapter 1
- Metrics are how humans interpret a model's performance, Loss is how the SGD algorithm interprets it.
- Head is the new layer of randomized weights added to a pre-trained model to customize it by transfer learning.
- Chapter 4
- Deep learning uses gradient to also refer to the value of the derivative at a specific point, instead of just the function itself.
- Automatic differentiation is in the autograd package, see Pytorch documentation: https://pytorch.org/docs/stable/autograd.html#function
- Chapter 1
- Exercises
- Ch1
- DL doesn't require lots of math, data, expensive computers or a PhD.
- 5 areas where DL is the best tool in the world
- NLP
- Image recognition
- Self-driving cars
- Playing Go
- Text generation
- Threshold logic unit (TLU) was the first artificial neuron. The network that used this was the Perceptron.
- Parallel distributed processing requirements:
- a set of processing units
- a state of activation
- output function for each unit
- pattern of connectivity among units
- propagation rule for propagating patterns through the network
- activation rule for combining inputs with current state to provide output
- a learning rule where patterns are modified by experience
- environment where the system must operate
Theoretical misunderstandings holding back neural networks
- People generalized the results of one layer being unable to simulate XOR, without realizing that multiple layers could.
- Adding just one layer could simulate any function, but it was too slow in practice with the size of the models; instead we need to add many more layers.
- GPU == graphical processing unit; multiple tiny processors for very high parallelism.
- 2
print(1 + 1)
- (Chapter workbook)
- I know Jupyter well enough.
- It's hard for normal programs to identify images because
- it's hard to define the steps we personally apply to identify an image.
- Weight assignments are values that define how a program will operate.
- We call weights the model parameters.
- (Input + Weights) -> Model -> Results -> Measure of performance (cycle back)
- Can't truly understand or describe the impacts of the different parameters or why they're set to that particular value in the first place.
- Universal approximation theorem
- Training a model: run it on several training cases that have labels to allow learning and iterating towards a correct solution.
- Feedback loops will reinforce biases, because the new training data will be more biased.
- 224 used to be a standard size, but is not strictly required; size now defines resource consumption vs better accuracy.
- Classification is choosing between different distinct classes of objects; regression is determining a best continuous numerical value.
Validation set is to actually evaluate the behavior of the model on data it hasn't been trained with; ultimately you end up tuning your hyper-parameters on the validation set.
Test set is the data that a fixed set of hyper-parameters and weights are evaluated against, so that there's no chance of training against it. Ideally, kept as a black box.
- Defaults to .2%; or randomly pulls out values2
- Random might not work for time series predictions; there a better validation set would be to predict the future from past data.
- Overfitting is when the model starts tuning itself too perfectly to the training data, so much that it' can't generalize to data it's seen before. For example, it might memorize all the inputs given enough training time.
- Metric is a human specific measure of the performance of a model. Loss is for the stochastic gradient descent function.
- Pre-trained models mean you need much less data and much less training time; the initial layers already break down most of the concepts of the data, we don't need to re-train them.
- Head is the additional layer added to customize a pre-trained model.
- Early layers of the CNN find things like edges, graphical concepts; later layers start finding things like eyes, etc.
- Image models can be applied to other concepts by converting the input into an image of some sort.
- Architecture = structure of the model, layers, number of neurons, etc. The template of th emodel that we're trying to fit; the actual mathematical function.
- Segmentation: a model that can understand every pixel of an image.
- yrange: Describes that it should return a range of numbers and not a specific classification.
- Hyperparameters: choices regarding network architecture, learning rates, data augmentation strategies, etc. Parameters about parameters.
- Maintain a testset that engineers/consultants can't train on to evaluate the model.
- GPUs allow for many more highly parallel computation, and have their own VRAM allowing a much higher bandwidth. Transferring memory from cpu to gpu can be slow.
- Feedback loops: anytime training data is derived only from results of running the previous model. Eg. filter bubbles in social networks, biased policing, etc.
- Ch2
- Depends on format; but some form of encoding of intensity, hue and saturation of pixels – either RGB, or grayscale; and then compressed lossily or otherwise.
- Validation files are already broken out separately. /valid, /train and labels.csv.
- Ch1
- Follow ups
- Read the Perceptrons paper.
- Visualize and understand ConNets
- Gramian Angular Difference Field
- Read the Parallel distributed processing book
- Read the papers underlying the universal approximation theorem.
- Actually write code for GPUs.