def backward(self, dEdY):
        # Here we ignore the dEdY because this is always the last layer...
        target = dEdY != 0.0
        targetInt = target.astype('int')
        targetIdx = np.nonzero(target)[1]
        mu = self.W[0]
        pi = self.W[1]
        dEdX = (-mu[targetIdx] + np.dot(self.Y, mu)) / float(self.X.shape[0])
        dEdX = dEdX.reshape(self.Xshape)
        dEdMu = np.mean(
            (self.X - mu) *  
            (self.Y - targetInt), axis=0)
        # Fix extreme mu's
        if self.fixExtreme:
            dEdMu[0] = 0
            dEdMu[-1] = 0
        dEdPi = np.mean(self.Y - targetInt, axis=0)
        self.dEdW = np.zeros(self.W.shape)
        self.dEdW[0] = dEdMu
        self.dEdW[1] = dEdPi
        return dEdX
dataset/ETHPy150Open renmengye/imageqa-public/src/nn/ordinal.py/OrdinalRegression.backward/original