SCUT-AILab / DCP

Code for “Discrimination-aware-Channel-Pruning-for-Deep-Neural-Networks”
BSD 3-Clause "New" or "Revised" License
184 stars 27 forks source link

Algorithm 1 fine-tuning #2

Closed kakusikun closed 5 years ago

kakusikun commented 5 years ago

In Algorithm 1, "Learn theta and Fine-tune M with (L^S)_p and L_f." which means that the weights of the first layer to layer L_p will be updated w.r.t to (L^S)_p and whole model weight will be updated w.r.t L_f (the final loss), is that right?

In this line, I can understand that i != index is going to update weights of the first layer to layer L_p by self.seg_optimizer[i].step() but the i != len(self.pruned_segments) - 1 is going to update weights of the first layer to the end of the second-last segment.

According to Algorithm 1, it should be the last segment, that is, the whole model, but why the second-last segment?

liujingcs commented 5 years ago

The i != len(self.pruned_segments) - 1 indeed is going to update weights of the first layer to the end of the last segment.

kakusikun commented 5 years ago

That's right. I forgot the zero-based index. Thanks for correction.