logistic power

    Parameters
    ----------
    x: int
    a: float
    b: float
    c: float

    Returns
    -------
    float
        a/(1.+(x/np.exp(b))**c)
489683
def log_power(x, a, b, c):
    "
    return a/(1.+(x/np.exp(b))**c)
703224
def _sumSeries(a: float, b: float, steps: int) -> float:
        
        return a * (exp(b * steps) - 1) / (exp(b) - 1)
149241
def log_sum_exp_ab(a, b):
    
    if a > b:
        return a + np.log(1. + np.exp(b - a))
    else:
        return b + np.log(1. + np.exp(a - b))
1223638
def _call(self, x):
        """"""
        if self.exponent == 0:
            return self.domain.one().inner(np.not_equal(x, 0))
        elif self.exponent == 1:
            return x.ufuncs.absolute().inner(self.domain.one())
        elif self.exponent == 2:
            return np.sqrt(x.inner(x))
        elif np.isfinite(self.exponent):
            tmp = x.ufuncs.absolute()
            tmp.ufuncs.power(self.exponent, out=tmp)
            return np.power(tmp.inner(self.domain.one()), 1 / self.exponent)
        elif self.exponent == np.inf:
            return x.ufuncs.absolute().ufuncs.max()
        elif self.exponent == -np.inf:
            return x.ufuncs.absolute().ufuncs.min()
        else:
            raise RuntimeError('unknown exponent')
983148
function powColVector(x, power) {
                var result = x.clone();
                for (var i = 0; i < x.rows; ++i) {
                    result[i][0] = Math.pow(result[i][0], power);
                }
                return result;
            }
61006
def Power(base: vertex_constructor_param_types, exponent: vertex_constructor_param_types, label: Optional[str]=None) -> Vertex:
    
    return Double(context.jvm_view().PowerVertex, label, cast_to_double_vertex(base), cast_to_double_vertex(exponent))
631888
def lnprior(self, X):
        
        if np.any(X < self._lower_left) or np.any(X > self._upper_right):
            return -np.inf
        else:
            return 0.0
1347663
def cpower(a,b):
    '''
    
    '''
    if sps.issparse(a): a = a.toarray()
    if sps.issparse(b): b = b.toarray()
    return a ** b
1181830
def prox_hard(X, step, thresh=0):
    
    thresh_ = _step_gamma(step, thresh)
    below = np.abs(X) < thresh_
    X[below] = 0
    return X
832875
def DampedPowerlaw(q, a, alpha, sigma):
    
    return a * q ** alpha * np.exp(-q ** 2 / (2 * sigma ** 2))
1366165
def exponential(x, y, xscale, yscale):
    
    if xscale==0.0 or yscale==0.0:
        return x*0.0

    with float_error_ignore():
        x_w = np.divide(x,xscale)
        y_h = np.divide(y,yscale)
        return np.exp(-np.sqrt(x_w*x_w+y_h*y_h))
219973
function logisticLoss(p, weights) {
  const [label, features] = p;
  const grad = [];
  let dotProd = 0;

  for (let i = 0; i < features.length; i++)
    dotProd += (features[i] || 0) * (weights[i] || 0);

  const tmp = 1 / (1 + Math.exp(-dotProd)) - label;

  for (let i = 0; i < features.length; i++)
    grad[i] = (features[i] || 0) * tmp;

  return grad;
}
1080046
def exp(x, context=None):
    
    return _apply_function_in_current_context(
        BigFloat,
        mpfr.mpfr_exp,
        (BigFloat._implicit_convert(x),),
        context,
    )
1264657
def pow2(x: int, p: int) -> int:
    """"""
    while p > 0:
        x = x * x % q
        p -= 1
    return x
559907
def _exponent(self):
        
        if self and is_finite(self):
            return mpfr.mpfr_get_exp(self)

        if not self:
            return '0'
        elif is_inf(self):
            return 'inf'
        elif is_nan(self):
            return 'nan'
        else:
            assert False, "shouldn't ever get here"
217017
def _quotient_exponent(x, y):
    
    assert mpfr.mpfr_regular_p(x)
    assert mpfr.mpfr_regular_p(y)

    # Make copy of x with the exponent of y.
    x2 = mpfr.Mpfr_t()
    mpfr.mpfr_init2(x2, mpfr.mpfr_get_prec(x))
    mpfr.mpfr_set(x2, x, mpfr.MPFR_RNDN)
    mpfr.mpfr_set_exp(x2, mpfr.mpfr_get_exp(y))

    # Compare x2 and y, disregarding the sign.
    extra = mpfr.mpfr_cmpabs(x2, y) >= 0
    return extra + mpfr.mpfr_get_exp(x) - mpfr.mpfr_get_exp(y)
1327969
def pow4(x, alpha, a, b, c):
    
    return c - (a*x+b)**-alpha