ClickMasters
← Back to all FAQ cards

Artificial Intelligence (AI)

Deep Learning Solutions FAQs

When should I use deep learning instead of gradient boosting?

Gradient boosting (XGBoost, LightGBM) should be your first choice for structured tabular data it consistently outperforms neural networks on tabular data with moderate dataset sizes, is faster to train, and is more interpretable. Use deep learning when: the input data is unstructured images, text, audio, or video where learned representations (convolutional features, transformer attention) capture patterns that hand-crafted features cannot; the dataset is large (100,000+ labelled examples) and the feature space is complex enough to justify the additional capacity of a neural network; or transfer learning from a pre-trained model (ImageNet-pretrained CNN, BERT-pretrained language model) dramatically reduces the labelled data requirement for a vision or NLP task. For tabular data, tabular deep learning methods (TabNet, FT-Transformer) can outperform gradient boosting specifically when high-cardinality categorical features benefit from learned embeddings.

What is transfer learning and how does it reduce data requirements?

Transfer learning uses a model pre-trained on a large general dataset as the starting point for training on a smaller task-specific dataset rather than training from random weights. For computer vision: a ResNet or EfficientNet pre-trained on ImageNet (1.2M labelled images, 1,000 classes) has learned general visual features edges, textures, shapes that transfer usefully to almost any visual recognition task. Fine-tuning this pre-trained model on 1,000-10,000 domain-specific labelled images produces better results than training from scratch on the same data. For NLP: BERT and its variants (RoBERTa, DeBERTa) pre-trained on billions of words have learned language representations that transfer to classification, NER, and QA tasks with 100-10,000 labelled examples. Transfer learning makes deep learning practical for B2B use cases where labelling costs limit dataset size.

What is the difference between PyTorch and TensorFlow?

PyTorch and TensorFlow are both production-grade deep learning frameworks, but they have evolved differently. PyTorch uses a dynamic computation graph (define-by-run) operations execute immediately when called, making debugging intuitive and code that looks like standard Python. PyTorch is the dominant framework in ML research (85%+ of papers) and increasingly in production. TensorFlow uses a static computation graph that is defined and then executed offering production deployment advantages (TensorFlow Serving, TFLite for mobile, TFX for pipelines) but historically more complex debugging. With the adoption of PyTorch 2.0's torch.compile and TorchServe for production serving, and ONNX for cross-framework deployment, the production deployment gap has largely closed. ClickMasters uses PyTorch as the primary framework for all new deep learning work, with TensorFlow for legacy model maintenance and TFLite targets.

How do you deploy a deep learning model for production inference?

Deep learning model deployment for production inference requires specific considerations beyond standard API deployment. Model serialisation: PyTorch models exported to TorchScript (graph mode, no Python runtime required) or ONNX (cross-framework, optimised by ONNX Runtime). Inference optimisation: ONNX Runtime applies graph optimisations and hardware-specific kernels typically 2-5x faster than naive PyTorch inference. Batching: TorchServe or Triton Inference Server batch multiple inference requests together, amortising the GPU/CPU overhead critical for throughput at scale. Hardware selection: GPU inference (AWS EC2 G5 instances) for throughput-sensitive applications; CPU inference (AWS ECS Fargate) for latency-tolerant batch processing at lower cost. Monitoring: track inference latency distribution, throughput, and model prediction distribution drift alert when the distribution shifts significantly from the training baseline.