Error function.
        Once self.y_desired has been defined, compute the error
        of input x using the forward model.
420514
def _error(self, x):
        
        y_pred = self.fmodel.predict_y(x)
        err_v  = y_pred - self.goal
        error = sum(e*e for e in err_v)
        return error
687596
def forward_prediction(self, m):
        
        return self.infer(self.conf.m_dims, self.conf.s_dims, m)
1313978
function _gpfGenenerateErrorFunction (code, name, message) {
    var result = _gpfErrorFactory(code, name, message);
    result.CODE = code;
    result.NAME = name;
    result.MESSAGE = message;
    return result;
}
698103
def _error_repr(error):
    """"""
    error_repr = repr(error)
    if len(error_repr) > 200:
        error_repr = hash(type(error))
    return error_repr
439883
def set_error(self, e):
        
        self.result = (False, e)
        self._lock.release()
923909
def err(self):
        
        # Initiallize error to nan
        err = odict(self.mle())
        err.update([(k,np.nan*np.ones(2)) for k in err.keys()])

        # Find the maximum likelihood
        a = self.log_likelihood_sparse_array
        j,k = np.unravel_index(a.argmax(),a.shape)

        self.loglike.set_params(distance_modulus=self.distance_modulus_array[j],
                                lon=self.roi.pixels_target.lon[k],
                                lat=self.roi.pixels_target.lat[k])
        self.loglike.sync_params()

        # Find the error in richness, starting at maximum
        lo,hi = np.array(self.loglike.richness_interval())
        err['richness'] = np.array([lo,hi])

        # ADW: This is a rough estimate of the distance uncertainty 
        # hacked to keep the maximum distance modulus on a grid index

        # This is a hack to get the confidence interval to play nice...
        # Require at least three points.
        if (a[:,k]>0).sum() >= 3:
            parabola = Parabola(np.insert(self.distance_modulus_array,0,0.), 
                                np.insert(a[:,k],0,0.) )
            lo,hi = np.array(parabola.confidenceInterval())
            err['distance_modulus'] = self.distance_modulus_array[j] + (hi-lo)/2.*np.array([-1.,1.])

        # ADW: Could estimate lon and lat from the grid.
        # This is just concept right now...
        if (a[j,:]>0).sum() >= 10:
            delta_ts = 2*(a[j,k] - a[j,:])
            pix = np.where(a[j,:][delta_ts < 2.71])[0]
            lons = self.roi.pixels_target.lon[pix]
            lats = self.roi.pixels_target.lat[pix]
            err['lon'] = np.array([ np.min(lons),np.max(lons)])
            err['lat'] = np.array([ np.min(lats),np.max(lats)])

        return err
1194050
def relative_error(self):
        
        if self.previous is not None:
            # FIXME
            # Use the maximum strain value -- this is important for error
            #  calculation with frequency dependent properties
            # prev = np.max(self.previous)
            # value = np.max(self.value)
            try:
                err = 100. * np.max((self.previous - self.value) / self.value)
            except ZeroDivisionError:
                err = np.inf
        else:
            err = 0
        return err
1315469
def on_error(self, ex):
        
        if self._d:
            self._d.errback()
            self._d = None
960263
def as_error(self) :
        ""
        result = dbus.Error.init()
        result.set(self.args[0], self.args[1])
        return \
            result
1057584
function modelIndexErrors(errors, context) {
        if (context && context.modelIndexErrors) {
            return context.modelIndexErrors(errors);
        }
        if (Array.isArray(errors)) {
            var rtn = {};
            _.each(errors, function(data) {
                for (var name in data) {
                    if (data.hasOwnProperty(name)) {
                        rtn[name] = data[name];
                    }
                }
            });
            return rtn;
        } else {
            return errors;
        }
    }
53586
def _mean_square_error(y, y_pred, w):
    """"""
    return np.average(((y_pred - y) ** 2), weights=w)
194742
def check_error(model, path, shapes, output = 'softmax_output', verbose = True):
    
    coreml_model = _coremltools.models.MLModel(path)
    input_data = {}
    input_data_copy = {}
    for ip in shapes:
        input_data[ip] = _np.random.rand(*shapes[ip]).astype('f')
        input_data_copy[ip] = _np.copy(input_data[ip])

    dataIter = _mxnet.io.NDArrayIter(input_data_copy)
    mx_out = model.predict(dataIter).flatten()

    e_out_dict = coreml_model.predict(_mxnet_remove_batch(input_data))
    e_out = e_out_dict[output].flatten()
    error = _np.linalg.norm(e_out - mx_out)

    if verbose:
        print("First few predictions from CoreML : %s" % e_out[0:10])
        print("First few predictions from MXNet  : %s" % e_out[0:10])
        print("L2 Error on random data %s" % error)
    return error
282952
def return_an_error(*args):
    '''
    '''
    list_errors = []
    list_errors.extend(list(args))

    errors = { 'errors': list_errors }
    return errors
261520
def error_future(self):
        
        fut = asyncio.Future(loop=self._loop)
        self._error_futures.append(fut)
        return fut
158120
def p_error_raise(p):
    
    q = make_number(1, lineno=p.lineno(2))
    r = make_binary(p.lineno(1), 'MINUS',
                    make_typecast(TYPE.ubyte, p[2], p.lineno(1)), q,
                    lambda x, y: x - y)
    p[0] = make_sentence('ERROR', r)
535128
def sg_graph_input(self, value, stream_id):
        """""""

        self.sensor_graph.process_input(stream_id, value)
        return [Error.NO_ERROR]
810559
def forward(self, input, target):
        

        n, k = input.shape
        losses = input.new_zeros(n)

        for i in range(k):
            cls_idx = input.new_full((n,), i, dtype=torch.long)
            loss = F.cross_entropy(input, cls_idx, reduction="none")
            if self.weight is not None:
                loss = loss * self.weight[i]
            losses += target[:, i].float() * loss

        if self.reduction == "mean":
            losses = losses.mean()
        elif self.reduction == "sum":
            losses = losses.sum()
        elif self.reduction != "none":
            raise ValueError(f"Unrecognized reduction: {self.reduction}")

        return losses