Skip to content

Commit 29faff1

Browse files
authored
Merge pull request #2106 from Khushi-Pushkar/main
Add_DeepLearning
2 parents de61112 + 578a03f commit 29faff1

File tree

6 files changed

+233
-0
lines changed

6 files changed

+233
-0
lines changed

docs/Deep Learning/Ann.md

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
---
2+
id: artificial-neural-networks
3+
title: Artificial Neural Networks
4+
sidebar_label: Artificial Neural Networks
5+
sidebar_position: 2
6+
tags: [Deep Learning, Artificial Neural Networks]
7+
8+
---
9+
10+
Artificial Neural Networks (ANNs) are computing systems inspired by the biological neural networks that constitute animal brains. They are a key component of deep learning and machine learning. ANNs consist of interconnected layers of nodes, called neurons, which process and transmit information. These networks are capable of learning from data, making them powerful tools for various applications.
11+
12+
### **Structure of ANNs**
13+
14+
![alt text](img2.png)
15+
16+
1. **Input Layer**: The input layer receives the initial data and passes it to the subsequent layers.
17+
2. **Hidden Layers**: These layers perform computations and feature extraction. There can be one or multiple hidden layers, making the network deeper and more capable of handling complex tasks.
18+
3. **Output Layer**: The final layer produces the output, which can be a classification, prediction, or any other result based on the input data.
19+
20+
The learning process of Artificial Neural Networks (ANNs) involves several key steps, starting from initializing the network to adjusting its parameters based on data. Here’s a detailed breakdown:
21+
22+
### 1. Initialization
23+
- **Architecture Design**: Choose the number of layers and the number of neurons in each layer. The architecture can be shallow (few layers) or deep (many layers).
24+
- **Weight Initialization**: Assign initial values to the weights and biases in the network. This can be done randomly or using specific strategies like Xavier or He initialization.
25+
26+
#### Example
27+
- **Architecture**: 1 input layer (2 neurons), 1 hidden layer (3 neurons), 1 output layer (1 neuron).
28+
- **Weights and Biases**: Randomly initialized.
29+
30+
### 2. Forward Propagation
31+
- **Input Layer**: The input layer receives the raw data. Each neuron in this layer represents an input feature.
32+
- **Hidden Layers**: Each neuron in a hidden layer computes a weighted sum of its inputs, adds a bias term, and applies an activation function (e.g., ReLU, Sigmoid, Tanh) to introduce non-linearity.
33+
- **Output Layer**: The final layer produces the network's output. The activation function in this layer depends on the task (e.g., Softmax for classification, linear for regression).
34+
35+
### 3. Loss Computation
36+
- **Loss Function**: Calculate the loss (or error) which quantifies the difference between the predicted output and the actual target. Common loss functions include Mean Squared Error (MSE) for regression and Cross-Entropy Loss for classification.
37+
38+
### 4. Backpropagation
39+
- **Gradient Computation**: Calculate the gradient of the loss function with respect to each weight and bias in the network using the chain rule of calculus. This involves computing the partial derivatives of the loss with respect to each parameter.
40+
- **Weight Update**: Adjust the weights and biases using a gradient-based optimization algorithm. The most common method is Stochastic Gradient Descent (SGD) and its variants (e.g., Adam, RMSprop). The update rule typically looks like:
41+
42+
![alt text](img3.png)
43+
44+
### 5. Epochs and Iterations
45+
- **Epoch**: One full pass through the entire training dataset.
46+
- **Iteration**: One update of the network's weights, usually after processing a mini-batch of data.
47+
48+
### 6. Convergence
49+
- **Stopping Criteria**: Training continues for a predefined number of epochs or until the loss converges to a satisfactory level. Early stopping can be used to halt training when performance on a validation set starts to degrade, indicating overfitting.
50+
51+
52+
The learning process of ANNs involves initializing the network, propagating inputs forward to compute outputs, calculating loss, backpropagating errors to update weights, and iterating until the model converges. Each step is crucial for the network to learn and make accurate predictions on new, unseen data.
53+
54+
### **Types of ANNs**
55+
56+
Artificial Neural Networks (ANNs) come in various types, each designed to address specific tasks and data structures. Here’s a detailed overview of the most common types of ANNs:
57+
58+
### 1. Feedforward Neural Networks (FNN)
59+
- The simplest type of ANN, where the data moves in only one direction—from the input layer through hidden layers to the output layer.
60+
- **Use Cases**: Basic pattern recognition, regression, and classification tasks.
61+
- **Example**: A neural network for predicting house prices based on features like size, location, and number of rooms.
62+
63+
### 2. Convolutional Neural Networks (CNN)
64+
- Specialized for processing grid-like data such as images. They use convolutional layers that apply filters to the input data to capture spatial hierarchies.
65+
- **Components**:
66+
- **Convolutional Layers**: Extract features from input data.
67+
- **Pooling Layers**: Reduce dimensionality and retain important information.
68+
- **Fully Connected Layers**: Perform classification based on extracted features.
69+
- **Use Cases**: Image and video recognition, object detection, and medical image analysis.
70+
- **Example**: A CNN for classifying handwritten digits (MNIST dataset).
71+
72+
### 3. Recurrent Neural Networks (RNN)
73+
- Designed for sequential data. They have connections that form directed cycles, allowing information to persist.
74+
- **Components**:
75+
- **Hidden State**: Carries information across sequence steps.
76+
- **Loop Connections**: Enable memory of previous inputs.
77+
- **Use Cases**: Time series prediction, natural language processing, and speech recognition.
78+
- **Example**: An RNN for predicting the next word in a sentence.
79+
80+
### 4. Long Short-Term Memory Networks (LSTM)
81+
- A type of RNN that addresses the vanishing gradient problem with a special architecture that allows it to remember information for long periods.
82+
- **Components**:
83+
- **Cell State**: Manages the flow of information.
84+
- **Gates**: Control the cell state (input, forget, and output gates).
85+
- **Use Cases**: Long-term dependency tasks like language modeling, machine translation, and speech synthesis.
86+
- **Example**: An LSTM for translating text from one language to another.
87+
88+
### 5. Gated Recurrent Units (GRU)
89+
- A simplified version of LSTM with fewer gates, making it computationally more efficient while still handling the vanishing gradient problem.
90+
- **Components**:
91+
- **Update Gate**: Decides how much past information to keep.
92+
- **Reset Gate**: Determines how much past information to forget.
93+
- **Use Cases**: Similar to LSTM, used for time series prediction and NLP tasks.
94+
- **Example**: A GRU for predicting stock prices.
95+
96+
### 6. Autoencoders
97+
- Neural networks used to learn efficient representations of data, typically for dimensionality reduction or denoising.
98+
- **Components**:
99+
- **Encoder**: Compresses the input into a latent-space representation.
100+
- **Decoder**: Reconstructs the input from the latent representation.
101+
- **Use Cases**: Anomaly detection, image denoising, and data compression.
102+
- **Example**: An autoencoder for reducing the dimensionality of a dataset while preserving its structure.
103+
104+
### 7. Variational Autoencoders (VAE)
105+
: A type of autoencoder that generates new data points by learning the probability distribution of the input data.
106+
- **Components**:
107+
- **Encoder**: Maps input data to a distribution.
108+
- **Decoder**: Generates data from the distribution.
109+
- **Use Cases**: Generative tasks like image and text generation.
110+
- **Example**: A VAE for generating new faces based on a dataset of human faces.
111+
112+
### 8. Generative Adversarial Networks (GAN)
113+
- Consists of two networks (generator and discriminator) that compete against each other. The generator creates data, and the discriminator evaluates it.
114+
- **Components**:
115+
- **Generator**: Generates new data instances.
116+
- **Discriminator**: Distinguishes between real and generated data.
117+
- **Use Cases**: Image generation, style transfer, and data augmentation.
118+
- **Example**: A GAN for generating realistic images of landscapes.
119+
120+
### 9. Radial Basis Function Networks (RBFN)
121+
- Uses radial basis functions as activation functions. Typically consists of three layers: input, hidden (with RBF activation), and output.
122+
- **Use Cases**: Function approximation, time-series prediction, and control systems.
123+
- **Example**: An RBFN for approximating complex nonlinear functions.
124+
125+
### 10. Self-Organizing Maps (SOM)
126+
- An unsupervised learning algorithm that produces a low-dimensional (typically 2D) representation of the input space, preserving topological properties.
127+
- **Use Cases**: Data visualization, clustering, and feature mapping.
128+
- **Example**: A SOM for visualizing high-dimensional data like customer purchase behavior.
129+
130+
### 11. Transformer Networks
131+
- A model architecture that relies on self-attention mechanisms to process input sequences in parallel rather than sequentially.
132+
- **Key Components**:
133+
- **Self-Attention Mechanism**: Computes the relationship between different positions in the input sequence.
134+
- **Feedforward Layers**: Process the self-attention outputs.
135+
- **Use Cases**: Natural language processing tasks like translation, summarization, and question answering.
136+
- **Example**: The Transformer model for language translation (e.g., Google Translate).
137+
138+
139+
Each type of ANN has its own strengths and is suited for different types of tasks. The choice of ANN depends on the specific problem at hand, the nature of the data, and the desired outcome. Understanding these various architectures allows for better design and implementation of neural networks to solve complex real-world problems.
140+
141+
### **Applications**
142+
143+
1. **Image and Video Recognition**: ANNs can identify objects, faces, and actions in images and videos.
144+
2. **Natural Language Processing (NLP)**: Used for tasks like language translation, sentiment analysis, and chatbots.
145+
3. **Speech Recognition**: Convert spoken language into text.
146+
4. **Predictive Analytics**: Forecasting future trends based on historical data.
147+
5. **Autonomous Systems**: Control systems in self-driving cars, robots, and drones.
148+
149+
### **Advantages**
150+
151+
1. **Adaptability**: ANNs can learn and adapt to new data.
152+
2. **Versatility**: Applicable to a wide range of tasks.
153+
3. **Efficiency**: Capable of processing large amounts of data quickly.
154+
155+
### **Challenges**
156+
157+
1. **Complexity**: Designing and training large neural networks can be complex and computationally intensive.
158+
2. **Data Requirements**: ANNs often require large amounts of labeled data for training.
159+
3. **Interpretability**: Understanding how a trained neural network makes decisions can be difficult.
160+
161+
### **Conclusion**
162+
163+
Artificial Neural Networks are a foundational technology in the field of artificial intelligence and machine learning. Their ability to learn from data and adapt to new situations makes them invaluable for a wide range of applications, from image recognition to autonomous systems. Despite their complexity and data requirements, the advancements in computational power and algorithms continue to enhance their capabilities and broaden their applications.

docs/Deep Learning/Intro.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
id: introducation-to-deep-learning
3+
title: Introducation to Deep Learning
4+
sidebar_label: Introducation to Deep Learning
5+
sidebar_position: 1
6+
tags: [Deep Learning]
7+
8+
---
9+
10+
Deep learning is a subset of machine learning and artificial intelligence (AI) that mimics the workings of the human brain in processing data and creating patterns for use in decision-making. It uses neural networks with many layers (hence "deep") to analyze various factors of data.
11+
12+
In a fully connected Deep neural network, there is an input layer and one or more hidden layers connected one after the other. Each neuron receives input from the previous layer neurons or the input layer. The output of one neuron becomes the input to other neurons in the next layer of the network, and this process continues until the final layer produces the output of the network. The layers of the neural network transform the input data through a series of nonlinear transformations, allowing the network to learn complex representations of the input data.
13+
14+
![alt text](img.png)
15+
16+
Today Deep learning AI has become one of the most popular and visible areas of machine learning, due to its success in a variety of applications, such as computer vision, natural language processing, and Reinforcement learning.
17+
18+
Deep learning AI can be used for supervised, unsupervised, and reinforcement machine learning, each utilizing different methods for processing data.
19+
20+
**Supervised Machine Learning**: In supervised machine learning, the neural network learns to make predictions or classify data based on labeled datasets. We provide both input features and target outcomes. The neural network learns by minimizing the error between predicted and actual targets through a process called backpropagation. Deep learning algorithms like Convolutional Neural Networks (CNNs) and Recurrent Neural Networks (RNNs) are used for tasks such as image classification, sentiment analysis, and language translation.
21+
22+
**Unsupervised Machine Learning**: In unsupervised machine learning, the neural network discovers patterns or clusters within unlabeled datasets, meaning there are no target variables. The machine identifies hidden patterns or relationships within the data. Deep learning algorithms like autoencoders and generative models are used for tasks such as clustering, dimensionality reduction, and anomaly detection.
23+
24+
**Reinforcement Machine Learning**: In reinforcement machine learning, an agent learns to make decisions in an environment to maximize a reward signal. The agent takes actions, observes the results, and receives rewards. Deep learning helps the agent learn policies, or sets of actions, that maximize cumulative rewards over time. Algorithms like Deep Q Networks (DQNs) and Deep Deterministic Policy Gradient (DDPG) are used for tasks like robotics and game playing.
25+
26+
## **Core Concept**
27+
- **Artificial Neural Networks (ANNs)** : Inspired by the structure and function of the human brain, ANNs consist of interconnected nodes (artificial neurons) that process information.
28+
29+
- **Hidden Layers**: Unlike simpler neural networks, deep learning models have multiple hidden layers between the input and output layers. These layers allow the network to learn increasingly complex features from the data.
30+
- **Learning Process**: Deep learning models learn through a process called backpropagation. This involves adjusting the connections between neurons based on the difference between the model's predictions and the actual data.
31+
32+
## **Key Characteristics of Deep Learning**
33+
34+
- **High Capacity**: Deep neural networks can learn intricate relationships within data due to their multiple layers and numerous connections.
35+
- **Unsupervised vs. Supervised Learning**: Deep learning can be applied in both supervised learning (models trained with labeled data) and unsupervised learning (models identify patterns in unlabeled data).
36+
- **Representation Learning**: Deep learning models can automatically learn features (representations) from the data, eliminating the need for manual feature engineering in many cases.
37+
38+
## **Benefits of Deep Learning**
39+
40+
- **Superior Performance**: Deep learning models have achieved state-of-the-art performance in various tasks, including image recognition, natural language processing, and speech recognition.
41+
- **Automating Feature Extraction**: Deep learning reduces the need for manual feature engineering, a time-consuming and domain-specific task.
42+
- **Handling Complex Data**: Deep learning can effectively handle complex data types like images, audio, and text, making it well-suited for modern applications.
43+
44+
## **Disadvantages of Deep Learning**
45+
- **High computational requirements**: Deep Learning AI models require large amounts of data and computational resources to train and optimize.
46+
Requires large amounts of labeled data: Deep Learning models often require a large amount of labeled data for training, which can be expensive and time- consuming to acquire.
47+
- **Interpretability**: Deep Learning models can be challenging to interpret, making it difficult to understand how they make decisions.
48+
- **Overfitting**: Deep Learning models can sometimes overfit to the training data, resulting in poor performance on new and unseen data.
49+
Black-box nature: Deep Learning models are often treated as black boxes, making it difficult to understand how they work and how they arrived at their predictions.
50+
51+
## **Applications of Deep Learning**
52+
53+
- **Computer Vision**: Image recognition, object detection, facial recognition, medical image analysis.
54+
- **Natural Language Processing**: Machine translation, sentiment analysis, text summarization, chatbots.
55+
- **Speech Recognition and Synthesis**: Voice assistants, automatic transcription, language learning apps.
56+
- **Recommender Systems**: Personalization of recommendations for products, music, movies, etc.
57+
- **Anomaly Detection**: Identifying unusual patterns or events in data for fraud detection, network security, etc.
58+
## **Challenges of Deep Learning**
59+
60+
- **Computational Cost**: Training deep learning models often requires significant computational resources and large datasets.
61+
- **Data Requirements**: Deep learning models can be data-hungry, and performance can suffer with limited data availability.
62+
- **Explainability**: Understanding how deep learning models arrive at their decisions can be challenging, limiting interpretability in some applications.

docs/Deep Learning/_category.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"label": "Deep Learning",
3+
"position": 14,
4+
"link": {
5+
"type": "generated-index",
6+
"description": "In this section, you will learn about Deep Learning"
7+
}
8+
}

docs/Deep Learning/img.png

24.1 KB
Loading

docs/Deep Learning/img2.png

16.1 KB
Loading

docs/Deep Learning/img3.png

8.19 KB
Loading

0 commit comments

Comments
 (0)