Artificial Intelligence Lab
Assignment 1
Design and Implementation of Fully Connected Neural
Networks
Md. Mahfuzar Rahman
ID: 2110976123
Session: 2020–21
Department: Computer Science and Engineering
University of Rajshahi
Fully Connected Neural Network Diagram
Figure 1: Fully Connected Neural Network Architecture
Explanation of the Diagram
The figure above represents a Fully Connected Neural Network (FCNN),
where each neuron in a layer is connected to all neurons in the next layer
through weighted connections.
Layer Roles:
• Input Layer: - Accepts the input features from the dataset. - In this
network, there are two input neurons (x1 and x2 ). - The input layer
does not perform computation; it simply forwards the feature values to
the first hidden layer.
• Hidden Layers: - Perform computations to transform inputs into
more useful intermediate representations. - Each neuron calculates a
weighted sum of inputs plus a bias term:
n
X
z= w i · xi + b
i=1
- An activation function f (z) is then applied to introduce non-linearity,
allowing the network to learn complex patterns. - In this architecture:
– Hidden Layer 1: 2 neurons (f1 |g1 and f2 |g2 ).
– Hidden Layer 2: 3 neurons (f3 |g3 , f4 |g4 , f5 |g5 ).
– Hidden Layer 3: 2 neurons (f6 |g6 and f7 |g7 ).
• Output Layer: - Produces the final output prediction from the net-
work. - Here, it has one neuron (f8 |g8 ) that combines the outputs of
the last hidden layer. - Depending on the activation function (e.g.,
sigmoid, softmax, linear), it can output probabilities (classification) or
continuous values (regression).
2
Model Summary Output
Figure 2: Model Summary of the Fully Connected Neural Network
Explanation of Model Summary
The model consists of:
• Input Layer: Shape (N one, 2), 0 parameters.
• Dense Layer 1: 2 neurons, 6 parameters (4 weights + 2 biases).
• Dense Layer 2: 3 neurons, 9 parameters (6 weights + 3 biases).
• Dense Layer 3: 2 neurons, 8 parameters (6 weights + 2 biases).
• Output Layer: 1 neuron, 3 parameters (2 weights + 1 bias).
• Total Parameters: 26 trainable parameters.
Resources
• GitHub Repository: GitHub - Artificial Intelligence Lab
• Google Colab Notebook: Colab - FCNN Implementation