def __init__(self, training_instances: List[Instance], n: int, lda=0.1, max_iter=50, verbose=False): """ :param training_instances: the instances on which to train :param n: the number of un-poisoned instances in training_instances - the size of the original data set :param lda: lambda - for regularization term :param max_iter - the maximum number of iterations :param verbose: if True, the solver will be in verbose mode """ Learner.__init__(self) self.set_training_instances(training_instances) self.n = n self.lda = lda # lambda self.max_iter = max_iter self.verbose = verbose self.fvs = None self.labels = None self.tau = None self.w = None self.b = None # If true, setup problem on train - only use for learners that use # the same instance of TRIM self.redo_problem_on_train = True self.temp_tuple = None self.irl_selection = np.full(len(self.training_instances), 1)
def __init__(self, training_instances, verbose=False): Learner.__init__(self) self.training_instances = training_instances self.verbose = verbose self.w = None self.mean = None self.std = None
def __init__(self, params=None, training_instances=None): Learner.__init__(self) self.weight_vector = None self.bias = 0 self.c_delta = 0.5 self.c = 1 if params is not None: self.set_params(params) if training_instances is not None: self.set_training_instances(training_instances)
def __init__(self, base_model=None, training_instances=None, attack_alg=None): Learner.__init__(self) self.model = Model(base_model) self.attack_alg = attack_alg # Type: class self.adv_params = None self.attacker = None # Type: Adversary self.set_training_instances(training_instances) self.iterations = 5 # int: control the number of rounds directly
def __init__(self, training_instances=None, coef=0.25, params=None): Learner.__init__(self) self.weight_vector = None # type: np.array(shape=(1)) self.num_features = 0 # type: int self.coef = coef # type: float self.bias = 0 # type: int if training_instances is not None: self.set_training_instances(training_instances) if params is not None: self.set_params(params)
def __init__(self, training_instances=None, params=None): Learner.__init__(self) self.weight_vector = None # type: np.array(shape=1) self.num_features = 0 # type: int self.hinge_loss_multiplier = 0.5 # type: float self.max_feature_deletion = 30 # type: int self.bias = 0 # type: int if params is not None: self.set_params(params) if training_instances is not None: self.set_training_instances(training_instances)