<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def compute_error(self, **args):
 """ Computes error for all non-output layers backwards through all projections. """

        for key in args:
            layer = self.getLayer(key)
            if layer.kind == 'Output':
                self.copyTargets(layer, args[key])
        self.verifyTargets() # better have targets set
        error, correct, total = self.ce_init()
        pcorrect = {}
        # go backwards through each proj but don't redo output errors!
        if len(self.cacheConnections) != 0:
            changeConnections = self.cacheConnections
        else:
            changeConnections = self.connections
        for connect in reverse(changeConnections):
            if connect.active and connect.toLayer.active and connect.fromLayer.active:
                connect.toLayer.delta = (connect.toLayer.error *
                                         (self.ACTPRIME(connect.toLayer.activation)))
                connect.fromLayer.error = connect.fromLayer.error + \
                                          Numeric.matrixmultiply(connect.weight, connect.toLayer.delta)
        # now all errors are set on all layers!
        pcorrect = self.getLayerErrors()
        return (error, correct, total, pcorrect)