#NEWLINE# def bprop_naive( self , error , permute = False ) : #NEWLINE# #INDENT# for dst in range ( self . ofmsize ) : #NEWLINE# #INDENT# rflinks = self . links [ dst ] #NEWLINE# A = error [ : , self . ofmlocs [ dst ] ] #NEWLINE# B = self . weights #NEWLINE# if permute : #NEWLINE# #INDENT# inds = np . random . permutation ( A . shape [ 1 ] ) #NEWLINE# np . dot ( A [ : , inds ] , B [ inds , : ] , self . bpropbuf ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# np . dot ( A , B , self . bpropbuf ) #NEWLINE# #UNINDENT# self . berror [ : , rflinks ] += self . bpropbuf