Professional Documents
Culture Documents
Mal Report 5
Mal Report 5
Submitted to:
DR. TEHSEEN ZIA
Submitted by:
MOHSIN IDREES
SP21-BAI-014
Activation Functions:
Forward Propagation:
- The `forward` method calculates the output of the neural network given an input.
- It does this by multiplying the input data with the weights, adding biases, and passing
the result through the sigmoid activation function.
Backpropagation:
- The `backward` method updates the weights and biases of the network based on the
difference between the predicted output and the actual target.
- This process is called backpropagation and is crucial for the network to learn from its
mistakes and improve its predictions.
- The `train` method iterates over the training data for a certain number of epochs
(iterations).
- During each epoch, it feeds the input data forward through the network, calculates the
loss (difference between predicted and actual output), and adjusts the weights and
biases accordingly to minimize this loss.
- We keep track of the training loss over epochs and plot it using Matplotlib.
- This visualization helps us understand how well our network is learning and whether
it's improving over time.
Testing the Trained Model:
- After training, we test our trained model by feeding it with new input data.
- We observe the predictions made by the network and compare them with the actual
target values to evaluate its performance.
CODE SNIPPETS:
OUTPUTS:
Epoch 100/1000, Loss: 0.24443114942704236
Epoch 200/1000, Loss: 0.23692622556266935