这里是用于在caffe中向后的函数, top是这一层的输出,bottom是前一层的输入
def backward(self,top,propagate_down,bottom):
if propagate_down[0] and self.count!=0:
bottom[0].diff[...]=0
bottom[0].diff[self.valid_index]=top[0].diff[...]
if propagate_down[1] and self.count!=0:
bottom[1].diff[...]=0
bottom[1].diff[self.valid_index]=top[1].diff[...]
呃...... .diff [...] = 0意味着什么?