Hyperparameter Tuning
This document contains the major list of hyperparamters that we can tune while training neural networks and even tree based models (LightGBM and XGBoost).
Learning rate
fastai
- We use
fastaifor most of image recognition and CCTV training pipeline. fastaiout of the box has support for finding the ideal learning rate usinglearn.lr_find()
Vanilla pytorch and PyTorch Lightning
https://github.com/davidtvs/pytorch-lr-finderthis link uses the same implementation used by the fastai folkshttps://pytorch-lightning.readthedocs.io/en/1.4.9/advanced/lr_finder.htmlofficial support from the Pytorch Lightning community
Keras Tuner
If you are using keras to build your deep learning model, take a look at KerasTuner → here
Number of layers in the neural network
This is purely done on the basis of empherical evidence and experimenting. There is no one right answer, the answer is subjective and it will be different for each problem.
Loss functions
Based on different problems, you must use different loss functions.
- Default is
BinaryCrossEntropy - For imbalanced datasets,
Weighted BinaryCrossEntropy - For segmentation (with class imbalance),
FocalLoss - and so on
Learning rate schedulers (lr_schedulers)
There was various learning rate schedulers available, please refer to link → here
Tree based parameters
For finding optimal parameters in LightGBM, XGBoost and Random Forrest types of models, use the following links