Example #1
0
    def eta(self, eta):
        if not (isinstance(eta, float) or isinstance(eta, int)):
            raise e.TypeError('`eta` should be a float or integer')
        if eta < 0:
            raise e.ValueError('`eta` should be >= 0')

        self._eta = eta
Example #2
0
    def a(self, a):
        if not isinstance(a, (float, int)):
            raise e.TypeError('`a` should be a float or integer')
        if a < 0:
            raise e.ValueError('`a` should be >= 0')

        self._a = a
Example #3
0
    def prunning_ratio(self, prunning_ratio):
        if not isinstance(prunning_ratio, (float, int)):
            raise e.TypeError('`prunning_ratio` should be a float or integer')
        if prunning_ratio < 0 or prunning_ratio > 1:
            raise e.ValueError('`prunning_ratio` should be between 0 and 1')

        self._prunning_ratio = prunning_ratio
Example #4
0
    def positive_field(self, positive_field):
        if not isinstance(positive_field, (float, int)):
            raise e.TypeError('`positive_field` should be a float or integer')
        if positive_field < 0 or positive_field > 1:
            raise e.ValueError('`positive_field` should be between 0 and 1')

        self._positive_field = positive_field
Example #5
0
    def n_trials(self, n_trials):
        if not isinstance(n_trials, int):
            raise e.TypeError('`n_trials` should be an integer')
        if n_trials <= 0:
            raise e.ValueError('`n_trials` should be > 0')

        self._n_trials = n_trials
Example #6
0
    def l(self, l):
        if not isinstance(l, (float, int)):
            raise e.TypeError('`l` should be a float or integer')
        if l < 0:
            raise e.ValueError('`l` should be >= 0')

        self._l = l
Example #7
0
    def c_max(self, c_max):
        if not isinstance(c_max, (float, int)):
            raise e.TypeError('`c_max` should be a float or integer')
        if c_max < self.c_min:
            raise e.ValueError('`c_max` should be >= `c_min`')

        self._c_max = c_max
Example #8
0
    def bw_min(self, bw_min):
        if not isinstance(bw_min, (float, int)):
            raise e.TypeError('`bw_min` should be a float or integer')
        if bw_min < 0:
            raise e.ValueError('`bw_min` should be >= 0')

        self._bw_min = bw_min
Example #9
0
    def PAR(self, PAR):
        if not isinstance(PAR, (float, int)):
            raise e.TypeError('`PAR` should be a float or integer')
        if PAR < 0 or PAR > 1:
            raise e.ValueError('`PAR` should be between 0 and 1')

        self._PAR = PAR
Example #10
0
    def LP(self, LP):
        if not isinstance(LP, int):
            raise e.TypeError('`LP` should be a integer')
        if LP <= 0:
            raise e.ValueError('`LP` should be > 0')

        self._LP = LP
Example #11
0
    def HMCR(self, HMCR):
        if not isinstance(HMCR, (float, int)):
            raise e.TypeError('`HMCR` should be a float or integer')
        if HMCR < 0 or HMCR > 1:
            raise e.ValueError('`HMCR` should be between 0 and 1')

        self._HMCR = HMCR
Example #12
0
    def PAR_min(self, PAR_min):
        if not isinstance(PAR_min, (float, int)):
            raise e.TypeError('`PAR_min` should be a float or integer')
        if PAR_min < 0 or PAR_min > 1:
            raise e.ValueError('`PAR_min` should be between 0 and 1')

        self._PAR_min = PAR_min
Example #13
0
    def bw(self, bw):
        if not isinstance(bw, (float, int)):
            raise e.TypeError('`bw` should be a float or integer')
        if bw < 0:
            raise e.ValueError('`bw` should be >= 0')

        self._bw = bw
Example #14
0
    def p(self, p):
        if not (isinstance(p, float) or isinstance(p, int)):
            raise e.TypeError('`p` should be a float or integer')
        if p < 0 or p > 1:
            raise e.ValueError('`p` should be between 0 and 1')

        self._p = p
Example #15
0
    def beta(self, beta):
        if not isinstance(beta, (float, int)):
            raise e.TypeError('`beta` should be a float or integer')
        if beta < 0:
            raise e.ValueError('`beta` should be >= 0')

        self._beta = beta
Example #16
0
    def pm(self, pm):
        if not isinstance(pm, (float, int)):
            raise e.TypeError('`pm` should be a float or integer')
        if pm < 0 or pm > 1:
            raise e.ValueError('`pm` should be between 0 and 1')

        self._pm = pm
Example #17
0
    def f(self, f):
        if not isinstance(f, (float, int)):
            raise e.TypeError('`f` should be a float or integer')
        if f < 0:
            raise e.ValueError('`f` should be >= 0')

        self._f = f
Example #18
0
    def min_depth(self, min_depth):
        if not isinstance(min_depth, int):
            raise e.TypeError('`min_depth` should be an integer')
        if min_depth <= 0:
            raise e.ValueError('`min_depth` should be > 0')

        self._min_depth = min_depth
Example #19
0
    def c_min(self, c_min):
        if not isinstance(c_min, (float, int)):
            raise e.TypeError('`c_min` should be a float or integer')
        if c_min < 0:
            raise e.ValueError('`c_min` should be >= 0')

        self._c_min = c_min
Example #20
0
    def max_depth(self, max_depth):
        if not isinstance(max_depth, int):
            raise e.TypeError('`max_depth` should be an integer')
        if max_depth < self.min_depth:
            raise e.ValueError('`max_depth` should be >= `min_depth`')

        self._max_depth = max_depth
Example #21
0
    def r_ratio(self, r_ratio):
        if not isinstance(r_ratio, (float, int)):
            raise e.TypeError('`r_ratio` should be a float or integer')
        if r_ratio < 0 or r_ratio > 1:
            raise e.ValueError('`r_ratio` should be between 0 and 1')

        self._r_ratio = r_ratio
Example #22
0
    def k_max(self, k_max):
        if not isinstance(k_max, int):
            raise e.TypeError('`k_max` should be an integer')
        if k_max <= 0:
            raise e.ValueError('`k_max` should be > 0')

        self._k_max = k_max
Example #23
0
    def n_p(self, n_p):
        if not isinstance(n_p, int):
            raise e.TypeError('`n_p` should be an integer')
        if n_p <= 0:
            raise e.ValueError('`n_p` should be > 0')

        self._n_p = n_p
Example #24
0
    def h_max(self, h_max):
        if not isinstance(h_max, int):
            raise e.TypeError('`h_max` should be an integer')
        if h_max <= 0:
            raise e.ValueError('`h_max` should be > 0')

        self._h_max = h_max
Example #25
0
    def r_min(self, r_min):
        if not isinstance(r_min, (float, int)):
            raise e.TypeError('`r_min` should be a float or integer')
        if r_min < 0:
            raise e.ValueError('`r_min` should be >= 0')

        self._r_min = r_min
Example #26
0
    def b(self, b):
        if not isinstance(b, (float, int)):
            raise e.TypeError('`b` should be a float or integer')
        if b < 0:
            raise e.ValueError('`b` should be >= 0')

        self._b = b
Example #27
0
    def p_crossover(self, p_crossover):
        if not isinstance(p_crossover, (float, int)):
            raise e.TypeError('`p_crossover` should be a float or integer')
        if p_crossover < 0 or p_crossover > 1:
            raise e.ValueError('`p_crossover` should be between 0 and 1')

        self._p_crossover = p_crossover
Example #28
0
    def gamma(self, gamma):
        if not isinstance(gamma, (float, int)):
            raise e.TypeError('`gamma` should be a float or integer')
        if gamma < 0:
            raise e.ValueError('`gamma` should be >= 0')

        self._gamma = gamma
Example #29
0
    def p_reproduction(self, p_reproduction):
        if not isinstance(p_reproduction, (float, int)):
            raise e.TypeError('`p_reproduction` should be a float or integer')
        if p_reproduction < 0 or p_reproduction > 1:
            raise e.ValueError('`p_reproduction` should be between 0 and 1')

        self._p_reproduction = p_reproduction
Example #30
0
    def clip_ratio(self, clip_ratio):
        if not isinstance(clip_ratio, (float, int)):
            raise e.TypeError('`clip_ratio` should be a float or integer')
        if clip_ratio < 0 or clip_ratio > 1:
            raise e.ValueError('`clip_ratio` should be between 0 and 1')

        self._clip_ratio = clip_ratio