Assignment 3: Feed Forward Neural Networks

Problem statement, starter notebook and submission details:

Overview

The ability to try many different neural network architectures to address a problem is what makes deep learning really powerful, especially compared to shallow learning techniques like linear regression, logistic regression, etc. In this assignment, you will:

  1. Explore the CIFAR10 dataset: https://www.cs.toronto.edu/~kriz/cifar.html
  2. Set up a training pipeline to train a neural network on a GPU
  3. Experiment with different network architectures & hyperparameters

Steps to complete the assignment

  1. Fork & run this notebook: https://jovian.ai/aakashns/03-cifar10-feedforward
  2. Fill out all the ??? in the notebook to complete the assignment, and commit the final version to Jovian
  3. Submit your assignment
  4. (Optional) Write a blog post on one of the topics suggested at the end of the notebook
  5. (Optional) Share your work with the community

Make sure to review the material from Lesson 3 before starting the assignment. Please reply here if you have any questions or face issues. The recommended platform for writing your blog post is medium.com .

Hi,

Getting an error while solving assignment 3.

link to my notebook - https://jovian.ai/hargurjeet/03-cifar10-feedforward

Check out my feed-forward-nn here: https://jovian.ai/saikrithik/03-cifar10-feedforward/v/3
tried with 3,4 layered nn with different parameters and here is the best version of em all.

From your notebook link, it seems like you haven’t had properly scripted the following class:

class CIFAR10Model(ImageClassificationBase):
    def __init__(self):
        super().__init__()
        ???
        
    def forward(self, xb):
        # Flatten images into vectors
        out = xb.view(xb.size(0), -1)
        # Apply layers & activation functions
        ???
        return out

I guess I came to the training part, or at least, I can get my codes to that point. With 2 hidden layers, I’m just able to get the accuracy over 0.5. How about yours?

1 Like

hi,

Apologies, I share an older version of the notebook.
Please find the latest link attached, I continue to get the error

You have a mistake in the code.
obraz
First you flatten the image into a vector.
Then you again use the unflattened version.

3 Likes

@Sebgolos Absolutely correct :+1:

Hi everyone,
My accuracy is 51.35 .Is this okay or I have to improve more?because i tried so many things for now and this is the best I have got.

1 Like

Hello, here is my assignment. Please feel free to check it out.

P.s. the max accuracy that my model got is 49%. :blush:

1 Like

Hi, this is my notebook. Feel free to make any suggestions: https://jovian.ai/lsalvador-ht/03-cifar10-feedforward

1 Like

While running the notebook on my computer in jupyter notebook i see it is not using my gpu. What shoulg i do?

Make sure that you have CUDA installed. If you don’t have nVidia GPU, then you can only use kaggle or colab.

I guess it will improve in the coming days until then revise the code again , All the best :+1:

Thanks a lot for suggesting me but I have tried a lot and found this is the best prediction for me.Should I submit??

Yaa you can submit this one.

Sir why I am getting "You cannot currently connect to a GPU due to usage limits in Colab.
Learn more

CLOSECONNECT WITHOUT GPU
when i am changing the runtype

Hi Hargurjeet,
How you solved this error ?, I am also getting this error.
Akbar

we have val_loss with some number? How do I understand it? for example, if I have val_acc as 0.12345, which means our model predicts 12.34% correctly for given images, How do i understand val_loss parameter??

val_loss is just an error value calculated from the target labels, and the predicted ones.
The smaller the value is, the better are the predictions.

It somehow relates to accuracy (the percent of correctly classified images), but you can’t say that 0.12345 val_loss = x% accuracy (it can’t be directly calculated).

Smaller val_loss -> smaller error produced by model -> better accuracy.