2
$\begingroup$

I am beginner in machine learning and I came across these terms while going through code of cnn, I want to know how to what exactly they mean and other question is that when the weights of network change? after each batch size or after every epoch? Thank you.

$\endgroup$
3
$\begingroup$

In the context of Convolution Neural Networks (CNN), Batch size is the number of examples that are fed to the algorithm at a time. This is normally some small power of 2 like 32,64,128 etc. During training an optimization algorithm computes the average cost over a batch then runs backpropagation to update the weights. In a single epoch the algorithm is run with $n_{batches} = {n_{examples} \over batchsize} $ times. Generally the algorithm needs to train for several epochs to achieve convergence of weight values. Every batch is normally sampled randomly from the whole example set.

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ so the weights will be updated '"n_batches" times in one epoch, right? $\endgroup$ – thisisbhavin Mar 26 '17 at 14:45
  • $\begingroup$ Yes, all weights are updated $n_{batches}$ times in a singe epoch. $\endgroup$ – farhanhubble Mar 26 '17 at 14:56

Not the answer you're looking for? Browse other questions tagged or ask your own question.