Set parameters and constants before training.
175374
def _pre_train(self,
                   stop_param_updates,
                   num_epochs,
                   updates_epoch):
        """"""
        # Calculate the total number of updates given early stopping.
        updates = {k: stop_param_updates.get(k, num_epochs) * updates_epoch
                   for k, v in self.params.items()}

        # Calculate the value of a single step given the number of allowed
        # updates.
        single_steps = {k: np.exp(-((1.0 - (1.0 / v)))
                        * self.params[k]['factor'])
                        for k, v in updates.items()}

        # Calculate the factor given the true factor and the value of a
        # single step.
        constants = {k: np.exp(-self.params[k]['factor']) / v
                     for k, v in single_steps.items()}

        return constants
289001
def set_parameters(self, **args):
        """"""
        not_used = set()
        not_given = set()
        for p in self.processors:
            nu, ng = p.set_parameters(**args)
            not_used = not_used.union(nu)
            not_given = not_given.union(ng)
        return not_used, not_given
1272741
def SetParametros(self, cuit, token, sign):
        ""
        self.Token = token
        self.Sign = sign
        self.Cuit = cuit
        return True
1058292
def set_parameters(self):
        
        for key in (ADMITTED_STR_PARAMETERS + ADMITTED_FLOAT_PARAMETERS +
                    ADMITTED_SET_PARAMETERS):
            try:
                val = getattr(self.gmpe, key)
            except AttributeError:
                pass
            else:
                setattr(self, key, val)
476289
def param (self, param, kwargs, default_value=False):
        """"""
        if param in kwargs:
            value= kwargs[param]
            del kwargs[param]
        else:
            value= default_value
        setattr (self, param, value)
910623
def PARAMLIMITS(self, value):
        """"""
        assert set(value.keys()) == set(self.PARAMLIMITS.keys()), "The \
                new parameter limits are not defined for the same set \
                of parameters as before."
        for param in value.keys():
            assert value[param][0] < value[param][1], "The new \
                    minimum value for {0}, {1}, is equal to or \
                    larger than the new maximum value, {2}"\
                    .format(param, value[param][0], value[param][1])
        self._PARAMLIMITS = value.copy()
829374
def set_parameters(self):
        

        # declare 1D arrays of both paramters
        if self.xscale != 'lin':
            self.xvals = np.logspace(np.log10(float(self.x_low)),
                                     np.log10(float(self.x_high)),
                                     self.num_x)

        else:
            self.xvals = np.linspace(float(self.x_low),
                                     float(self.x_high),
                                     self.num_x)

        if self.yscale != 'lin':
            self.yvals = np.logspace(np.log10(float(self.y_low)),
                                     np.log10(float(self.y_high)),
                                     self.num_y)

        else:
            self.yvals = np.linspace(float(self.y_low),
                                     float(self.y_high),
                                     self.num_y)

        self.xvals, self.yvals = np.meshgrid(self.xvals, self.yvals)
        self.xvals, self.yvals = self.xvals.ravel(), self.yvals.ravel()

        for which in ['x', 'y']:
            setattr(self, getattr(self, which + 'val_name'), getattr(self, which + 'vals'))

        self.ecc = 'eccentricity' in self.__dict__
        if self.ecc:
            if 'observation_time' not in self.__dict__:
                if 'start_time' not in self.__dict__:
                    raise ValueError('If no observation time is provided, the time before'
                                     + 'merger must be the inital starting condition.')
                self.observation_time = self.start_time  # small number so it is not zero
        else:
            if 'spin' in self.__dict__:
                self.spin_1 = self.spin
                self.spin_2 = self.spin

        for key in ['redshift', 'luminosity_distance', 'comoving_distance']:
            if key in self.__dict__:
                self.dist_type = key
                self.z_or_dist = getattr(self, key)

            if self.ecc:
                for key in ['start_frequency', 'start_time', 'start_separation']:
                    if key in self.__dict__:
                        self.initial_cond_type = key.split('_')[-1]
                        self.initial_point = getattr(self, key)

        # add m1 and m2
        self.m1 = (self.total_mass / (1. + self.mass_ratio))
        self.m2 = (self.total_mass * self.mass_ratio / (1. + self.mass_ratio))
        return
364347
def _set_trainer(self, trainer):
        
        # trainer cannot be replaced for sparse params
        if self._stype != 'default' and self._trainer and trainer and self._trainer is not trainer:
            raise RuntimeError(
                "Failed to set the trainer for Parameter '%s' because it was already set. " \
                "More than one trainers for a %s Parameter is not supported." \
                %(self.name, self._stype))
        self._trainer = trainer
967862
def _setup_parameters(self):
        
        # facet
        self.facet.set(
            layout=self.layout,
            theme=self.theme,
            coordinates=self.coordinates,
            figure=self.figure,
            axs=self.axs
        )

        # layout
        self.layout.axs = self.axs
        # theme
        self.theme.figure = self.figure
1262358
def set_params(method, params):
    """"""
    data = {'method': method, 'params': params, 'id': str(uuid4())}
    return json.dumps(data)
1173496
def setup_parametrization(result, parametrize):
    """"""
    if parametrize:
        # remove parameters from title
        title = result.get("title")
        if title:
            result["title"] = TEST_PARAM_RE.sub("", title)
    else:
        # don't parametrize if not specifically configured
        if "params" in result:
            del result["params"]
789586
def setParams(self, minSupport=0.3, minConfidence=0.8, itemsCol="items",
                  predictionCol="prediction", numPartitions=None):
        
        kwargs = self._input_kwargs
        return self._set(**kwargs)
621034
def validate_parameters(self):
        """"""
        for p in self.params:
            if p not in self.known_params:
                raise errors.UnknownParameter(p, self.known_params)
411822
def set_params(self, params):
        
        for k,v in params.iteritems():
            self.set_param(k,v)
855520
def setParams(self, inputCol=None, outputCol=None, stopWords=None, caseSensitive=False,
                  locale=None):
        
        kwargs = self._input_kwargs
        return self._set(**kwargs)
57356
def set_params_value(self, *params):
        
        if len(params) != len(self.parameters):
            raise Exception("parameter error")
        temp = self.parameters
        self.parameters = []
        for i in range(len(params)):
            self.parameters.append(Parameter(temp[i]['name'], temp[i]['type']))
            self.parameters[i].set_value(params[i])
1093074
def setParameter(self, parameterName, index, parameterValue):
    
    if parameterName in self._poolerArgNames:
      setattr(self._pooler, parameterName, parameterValue)
    elif hasattr(self, parameterName):
      setattr(self, parameterName, parameterValue)
    else:
      raise Exception("Unknown parameter: " + parameterName)