0% found this document useful (0 votes)
5 views1 page

Report

The report details the implementation of neural networks using PyTorch for both regression and classification tasks. The regression model achieved a training MSE of 0.0048, while the classification model attained 100% accuracy by epoch 18. The report notes the challenges faced in tuning the regression model's learning rate and the relative ease of the classification task due to dataset simplicity.

Uploaded by

Mubassir Patel
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

Report

The report details the implementation of neural networks using PyTorch for both regression and classification tasks. The regression model achieved a training MSE of 0.0048, while the classification model attained 100% accuracy by epoch 18. The report notes the challenges faced in tuning the regression model's learning rate and the relative ease of the classification task due to dataset simplicity.

Uploaded by

Mubassir Patel
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Assignment Report: Neural Networks with Py-

Torch
Name: Mubassir Gamfoi Date: 09/26/2025

1. Regression Task
Model Architecture - Input: 100-dimensional vector - Dense(128, ReLU) →
Dense(64, ReLU) → Dense(1)
Hyperparameters - Learning rate: 0.001 - Batch size: 64 - Epochs: 25 -
Optimizer: Adam - Loss: MSELoss
Final Results - Training MSE = 0.0048
Observations - Model converged smoothly with Adam. - Final MSE is far
below the 0.5 threshold required for full marks.

2. Classification Task
Model Architecture - Input: 100-dimensional vector - Dense(128, ReLU) →
Dense(64, ReLU) → Dense(10)
Hyperparameters - Learning rate: 0.001 - Batch size: 64 - Epochs: 25 -
Optimizer: Adam - Loss: CrossEntropyLoss
Final Results - Training Accuracy = 100%
Observations - Model reached >75% accuracy within 3 epochs. - Achieved
100% accuracy by epoch 18.

3. Challenges and Insights


• Regression task required careful tuning of learning rate.
• Classification task was relatively easy, suggesting dataset simplicity.

Common questions

Powered by AI

The learning task evaluated using MSELoss is a regression task. MSELoss, or Mean Squared Error Loss, is appropriate for this task because it measures the average squared difference between estimated and actual values, which is ideal for continuous data prediction. In regression, the goal is to predict a continuous output, and reducing the MSE indicates that the model predictions are becoming closer to the actual values over time .

The regression task may require more careful tuning of the learning rate because it deals with continuous outputs that need precise adjustments to minimize error, whereas classification typically involves discrete classes which might allow for broader margin in transitions between classes. The fine-tuning ensures the learning rate is small enough to allow clear gradual improvements without overshooting the local minima, providing the low MSE observed .

The classification model architecture achieves 100% accuracy with layers of Dense(128, ReLU) followed by Dense(64, ReLU) and then Dense(10), suitable for a multi-class classification task. The simplicity in achieving 100% accuracy might imply that the dataset is not complex or lacks variability, allowing the model to easily memorize the training data .

The rapid achievement of over 75% accuracy within three epochs indicates high model and data compatibility, suggesting that the model's architecture was well-suited to capture the patterns present in the data. This also implies that the data is likely well-structured and noise-free, which allowed the model's parameters to quickly align with the underlying distributions in the data .

The final MSE being far below the 0.5 threshold required for full marks suggests that the model performed exceptionally well in approximating the target function. This indicates effective architecture and training process, possibly signaling minimal noise in the dataset or high-quality feature representations, which facilitated the model in capturing the underlying patterns accurately .

Batch size impacts the learning speed and stability of neural networks. In the context of the models, a batch size of 64 strikes a balance between efficient computation and effective gradient estimation, enabling smoother updates. It allows the models to more accurately estimate the direction of the gradient, stabilizing training despite noise and preventing overfitting by averaging over batches, thus facilitating reliable convergence for both tasks .

The use of ReLU (Rectified Linear Unit) in hidden layers helps overcome issues like vanishing gradients that can occur with sigmoid or tanh activations, enabling models to learn more important and extensive features effectively. ReLU activation allows the models to converge faster by maintaining computational efficiency and non-linearity, providing the capability to learn complex patterns necessary for both regression and classification tasks as described .

The model architecture, with initial dense layers capable of handling 128 neurons, was likely designed to extract significant features from the 100-dimensional input. By using substantial hidden layers with ReLU activations, the model can learn complex hierarchies and transformations effectively before passing output to the next layer. Such a structure ensures that significant relationships in the high-dimensional space are captured, thus optimizing the learning process for both regression and classification tasks .

The regression task's model converged smoothly as evidenced by the low MSE, indicating effective learning and adjustments in the learning rate. Meanwhile, the classification model achieved high accuracy rapidly, suggesting quicker convergence in learning although potentially at the expense of overfitting. This contrast implies that while both models performed well, the regression task required more nuanced parameter tuning for convergence, reflecting diverse learning dynamics between continuous versus categorical prediction tasks .

The Adam optimizer likely influenced the training processes positively by allowing faster convergence due to its adaptive learning rate capability, which is beneficial for both regression and classification tasks. For regression, it aided in fine-tuning the learning rate to smoothly converge to a low MSE, while for classification, it facilitated achieving rapid improvements in accuracy, evidenced by surpassing 75% within the first three epochs .

You might also like