🚀 AI Interview Questions with Answers (Part 6)
51. What is Deep Learning, and how is it different from Machine Learning?
Deep Learning is a subset of Machine Learning that uses artificial neural networks with multiple hidden layers to learn complex patterns from large datasets.
Machine Learning
- Often requires manual feature engineering.
- Works well with smaller datasets.
- Less computationally intensive.
Deep Learning
- Automatically learns features from raw data.
- Performs better on large datasets.
- Requires high computational power (GPUs/TPUs).
Applications: Image recognition, speech recognition, NLP, autonomous vehicles.
---
52. What is an artificial neural network, and how does it work?
An Artificial Neural Network (ANN) is a computational model inspired by the human brain. It consists of interconnected neurons that process information.
Components:
- Input Layer
- Hidden Layer(s)
- Output Layer
How it works:
1. Input data is fed into the network.
2. Each neuron applies weights and an activation function.
3. The output is passed to the next layer.
4. The final prediction is generated.
5. Errors are minimized using backpropagation.
---
53. What is a perceptron in Deep Learning?
A perceptron is the simplest type of artificial neuron and the basic building block of neural networks.
It:
- Receives input values.
- Multiplies them by weights.
- Adds a bias.
- Applies an activation function.
- Produces an output.
Perceptrons are suitable only for solving linearly separable problems.
---
54. What are hidden layers in a neural network?
Hidden layers are the layers between the input and output layers.
Their purpose is to:
- Learn complex patterns.
- Extract useful features.
- Improve prediction accuracy.
Deep Learning models typically contain multiple hidden layers, enabling them to solve complex tasks.
---
55. What are activation functions, and why are they used?
Activation functions determine whether a neuron should be activated and introduce non-linearity into neural networks.
Without activation functions, a neural network behaves like a simple linear model and cannot solve complex problems.
Common activation functions include:
- ReLU
- Sigmoid
- Tanh
- Softmax
---
56. What is the difference between ReLU, Sigmoid, and Tanh activation functions?
ReLU (Rectified Linear Unit)
- Outputs 0 for negative values and the input itself for positive values.
- Fast and widely used in hidden layers.
Sigmoid
- Produces outputs between 0 and 1.
- Commonly used for binary classification output layers.
Tanh
- Produces outputs between -1 and 1.
- Centers data around zero, often leading to faster convergence than Sigmoid.
---
57. What is backpropagation, and how does it train neural networks?
Backpropagation is the algorithm used to train neural networks by minimizing prediction errors.
Steps:
1. Perform a forward pass to generate predictions.
2. Calculate the loss.
3. Compute gradients using the chain rule.
4. Update weights using an optimizer.
5. Repeat until the model converges.
---
58. What is gradient descent, and what are its different variants?
Gradient Descent is an optimization algorithm that minimizes the loss function by updating model parameters in the direction of the steepest decrease.
Variants:
- Batch Gradient Descent
- Stochastic Gradient Descent (SGD)
- Mini-Batch Gradient Descent
Mini-Batch Gradient Descent is the most commonly used because it balances speed and stability.
---
59. What is an optimizer, and what are the common optimization algorithms?
An optimizer updates a model's weights to reduce the loss during training.
Popular optimizers:
- SGD (Stochastic Gradient Descent)
- Momentum
- RMSProp
- Adam
- AdamW
- Adagrad
Among these, Adam is one of the most widely used because it combines fast convergence with adaptive learning rates.
---
60. What is a loss function?
A loss function measures how far a model's predictions are from the actual values.
The objective of training is to minimize this loss.
Double Tap ❤️ For Part-7
Post #1825
2.5K
- ❤ 10