Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Caffe LeNet: Difference between `solver.step(1)` and `solver.net.forward()`

I was checking the Caffe LeNet Tutorial here and a question came to mind:

What's the difference between these 2 codes:

self.solver.step(1)

and

self.solver.net.forward()  # train net

They both seem to train the network at least according to the comment.

Personally I think the first one trains the network on the training data and updates the weights of both net and test_net but the second one seems to only forward a batch of data and apply the learned weights from the previous step.

If what I think is right, then what is the purpose of the second code in the tutorial? why did the code do a net.forward ? can't solver.step(1) do this itself?

Thanks for your time

like image 849
Cypher Avatar asked Jun 25 '16 06:06

Cypher


1 Answers

step does one full iteration, covering all three phases: forward evaluation, backward propagation, and update. The call to forward does only the first of these. There are also differences in the signature (parameter list).

like image 192
Prune Avatar answered Sep 21 '22 11:09

Prune