r"""Variable to be evaluated in computing the :math:`\ell_1`
        regularisation term, depending on the ``gEvalY`` option value.
18797
def obfn_g1var(self):
        
        """

        # Use of self.block_sep1(self.AXnr) instead of self.cnst_A1(self.X)
        # reduces number of calls to self.cnst_A0
        return self.var_y1() if self.opt['gEvalY'] else \
            self.block_sep1(self.AXnr)
780009
private void applyL1Reg(final double eta_t, Vec x)
    {
        //apply l1 regularization
        if(lambda1 > 0)
        {
            l1U += eta_t*lambda1;//line 6: in Tsuruoka et al paper, figure 2
            for(int k = 0; k < ws.length; k++)
            {
                final Vec w_k = ws[k];
                final double[] l1Q_k = l1Q[k];
                for(IndexValue iv : x)
                {
                    final int i = iv.getIndex();
                    //see "APPLYPENALTY(i)" on line 15: from Figure 2 in Tsuruoka et al paper
                    final double z = w_k.get(i);
                    double newW_i = 0;
                    if (z > 0)
                        newW_i = Math.max(0, z - (l1U + l1Q_k[i]));
                    else if(z < 0)
                        newW_i = Math.min(0, z + (l1U - l1Q_k[i]));
                    l1Q_k[i] += (newW_i - z);
                    w_k.set(i, newW_i);
                }
            }
        }
    }
698493
def _le_from_lt(self, other):
    """"""
    op_result = self.__lt__(other)
    return op_result or self == other
994492
def _maybe_normalize(self, var):
        
        if self.normalize:
            try:
                return self._norm.normalize(var)
            except HGVSUnsupportedOperationError as e:
                _logger.warning(str(e) + "; returning unnormalized variant")
                # fall through to return unnormalized variant
        return var
127567
def _get_value(self, variable):
        """"""
        return swiglpk.glp_get_col_prim(
            self._problem._p, self._problem._variables[variable])
955310
def ge(self, value):
        
        self.op = '>='
        self.negate_op = '<'
        self.value = self._value(value)
        return self
1254805
def obfn_reg(self):
        

        rl1 = np.linalg.norm((self.wl1 * self.obfn_gvar()).ravel(), 1)
        return (self.lmbda*rl1, rl1)
300686
def evaluate_at(self, vals):
        """"""
        new_vals = self._vals.copy()
        new_vals.update(vals)
        return self.__class__(self.operand, derivs=self._derivs, vals=new_vals)
1348335
def __inner_eval(self, data_name, data_idx, feval=None):
        """"""
        if data_idx >= self.__num_dataset:
            raise ValueError("Data_idx should be smaller than number of dataset")
        self.__get_eval_info()
        ret = []
        if self.__num_inner_eval > 0:
            result = np.zeros(self.__num_inner_eval, dtype=np.float64)
            tmp_out_len = ctypes.c_int(0)
            _safe_call(_LIB.LGBM_BoosterGetEval(
                self.handle,
                ctypes.c_int(data_idx),
                ctypes.byref(tmp_out_len),
                result.ctypes.data_as(ctypes.POINTER(ctypes.c_double))))
            if tmp_out_len.value != self.__num_inner_eval:
                raise ValueError("Wrong length of eval results")
            for i in range_(self.__num_inner_eval):
                ret.append((data_name, self.__name_inner_eval[i],
                            result[i], self.__higher_better_inner_eval[i]))
        if feval is not None:
            if data_idx == 0:
                cur_data = self.train_set
            else:
                cur_data = self.valid_sets[data_idx - 1]
            feval_ret = feval(self.__inner_predict(data_idx), cur_data)
            if isinstance(feval_ret, list):
                for eval_name, val, is_higher_better in feval_ret:
                    ret.append((data_name, eval_name, val, is_higher_better))
            else:
                eval_name, val, is_higher_better = feval_ret
                ret.append((data_name, eval_name, val, is_higher_better))
        return ret
514122
def value_and_grad(fun, x):
    """"""
    vjp, ans = _make_vjp(fun, x)
    if not vspace(ans).size == 1:
        raise TypeError("value_and_grad only applies to real scalar-output "
                        "functions. Try jacobian, elementwise_grad or "
                        "holomorphic_grad.")
    return ans, vjp(vspace(ans).ones())
1366427
def _le_from_ge(self, other):
    """"""
    op_result = self.__ge__(other)
    if op_result is NotImplemented:
        return NotImplemented
    return not op_result or self == other
230685
def value(self, term, **kwargs):
        
        term = self._normalize(term)
        if term in self._values:
            return self._values[term]
        for classifier in self.classifiers:
            v = classifier.value(term, **kwargs)
            if v is not None:
                return v
944544
def lnlike(x, star):
    """"""
    ll = lnprior(x)
    if np.isinf(ll):
        return ll, (np.nan, np.nan)
    per, t0, b = x
    model = TransitModel('b', per=per, t0=t0, b=b, rhos=10.)(star.time)
    like, d, vard = star.lnlike(model, full_output=True)
    ll += like
    return ll, (d,)
180485
def eval(e, amplitude, e_0, alpha, e_cutoff, beta):
        

        xx = e / e_0
        return amplitude * xx ** (-alpha) * np.exp(-(e / e_cutoff) ** beta)
601513
def eval_objfn(self):
        

        dfd = self.obfn_dfd()
        prj = sp.proj_l1(self.obfn_gvar(), self.gamma, axis=0)
        cns = np.linalg.norm(prj - self.obfn_gvar())
        return (dfd, cns)
811052
def layer_norm_vars(filters):
  """"""
  scale = tf.get_variable(
      "layer_norm_scale", [filters], initializer=tf.ones_initializer())
  bias = tf.get_variable(
      "layer_norm_bias", [filters], initializer=tf.zeros_initializer())
  return scale, bias
504435
def sg_leaky_relu(x, opt):
    
    """
    return tf.where(tf.greater(x, 0), x, 0.01 * x, name=opt.name)