Answers.Body: <p>Besides the last layer rest of the weights are shared among all classes. When an image is passed to the network all weights are updated accordingly. The only weights that are directly responsible for one specific class are the ones of the final layer. The rest of the weights are updated to find the best values to minimize the average loss for all classes.</p>
  
  <p>To rephrase there aren't "filters" in convolutional layers that are specific for a single class. They are used to extract features so that the final layer can make the final prediction (which has weights for each specific class).</p>
  
  <p>I'd suggest you look a bit into how gradient descent and backpropagation works. </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-03-31T14:30:45.510Z
Answers.LastActivityDate: 2020-03-31T14:30:45.510Z
Answers.UserDisplayName: Djib2011
Body: <p>I am new to CNN. What I have learned so far about the filters is that when we are giving a training example to our model, our model updates the weights by gradient descent to minimize the loss function.
  So my question is how the weights are retained for a particular class label?</p>
  
  <p>The question is vague as my knowledge is vague. It's my 4th hour to CNN.</p>
  
  <p>For example, if I am talking about the MNIST dataset with 10 labels. Let's say I am giving 1 image to my model initially. It will have a bigger loss for the forward pass. Let's say now it came for the back pass and adjusted the weights for and minimized the loss function for that label. 
  Now, when a new label arrives for training, how will it update the weights for filters which have already been updated according to the previous label?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-03-31T11:08:38.793Z
Comments.Text: Hi and welcome to AI SE! Your question is indeed unclear and vague. Are you familiar with gradient descent and back-propagation?
Comments.UserDisplayName: nbro
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-03-31T17:59:26.517Z
Comments.Text: Hey I read about it from some links. Can you provide me an easy to go source ?
Comments.UserDisplayName: kd369
Tags: <machine-learning><convolutional-neural-networks><backpropagation><objective-functions><gradient-descent>
Title: How are the weights retained for filters for a particular class in a CNN?
UserDisplayName: kd369
ThreadText: # How are the weights retained for filters for a particular class in a CNN?
  
  (Asked by: username_0 on 2020-03-31)
  
  I am new to CNN. What I have learned so far about the filters is that when we are giving a training example to our model, our model updates the weights by gradient descent to minimize the loss function.
  So my question is how the weights are retained for a particular class label?
  
  The question is vague as my knowledge is vague. It's my 4th hour to CNN.
  
  For example, if I am talking about the MNIST dataset with 10 labels. Let's say I am giving 1 image to my model initially. It will have a bigger loss for the forward pass. Let's say now it came for the back pass and adjusted the weights for and minimized the loss function for that label.
  Now, when a new label arrives for training, how will it update the weights for filters which have already been updated according to the previous label?
  
  **Tags:** machine-learning, convolutional-neural-networks, backpropagation, objective-functions, gradient-descent
  > **Comments:**
  > **username_1**: Hi and welcome to AI SE! Your question is indeed unclear and vague. Are you familiar with gradient descent and back-propagation?  
  > **username_0**: Hey I read about it from some links. Can you provide me an easy to go source ?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2020-03-31. Score: 1
  
  Besides the last layer rest of the weights are shared among all classes. When an image is passed to the network all weights are updated accordingly. The only weights that are directly responsible for one specific class are the ones of the final layer. The rest of the weights are updated to find the best values to minimize the average loss for all classes.
  
  To rephrase there aren't "filters" in convolutional layers that are specific for a single class. They are used to extract features so that the final layer can make the final prediction (which has weights for each specific class).
  
  I'd suggest you look a bit into how gradient descent and backpropagation works.
  
  
  ---
  
  