Commit 6f258ef5 authored by Martin Řepa's avatar Martin Řepa

Fix experiments

parent fe862c7e
......@@ -26,9 +26,9 @@ class Attacker:
return [np.random.uniform(0.0, 1.0) for _ in range(self.features_count)]
def get_initial_action(self) -> List:
return [1., 1.]
# return [1., 1.]
# return [0.59897846, 0.2900984]
# return self.random_action()
return self.random_action()
def get_best_response(self, def_actions: List, def_probs: List):
logger.info('Attacker searching for response')
......
......@@ -27,7 +27,7 @@ class DefenderConfig:
# New actor's action is considered already played in the game if difference
# between utility of new action and nash equilibrium value of zero-sum game
# is less than this value
defender_epsilon: float = attr.ib(default=1e-2)
defender_epsilon: float = attr.ib(default=1e-3)
# This number of neural networks will be trained in each double oracle
# iteration and the best one will be considered as a best response
......@@ -54,7 +54,7 @@ class AttackerConfig:
# New actor's action is considered already played in the game if difference
# between utility of new action and nash equilibrium value of zero-sum game
# is less than this value
epsion: float = attr.ib(default=1e-2)
epsion: float = attr.ib(default=1e-3)
# Number of random tries to find attacker action using gradient descent.
# The one with best final loss value would be chosen.
......@@ -93,7 +93,7 @@ class ModelConfig:
i_d: int = attr.ib(default=2)
# malicious : benign ratio in datatests
benign_ratio: int = attr.ib(default=10)
benign_ratio: int = attr.ib(default=5)
# Function to calculate utility for attacker given the actions
# f: List[float], NeuralNetwork -> float
......
......@@ -6,6 +6,6 @@ epochs:
upper_bound: 14000 # 30000
conf:
i_a: 1
i_d: 2
i_d: 3
benign_ratio: 5
data_file: normal_distribution_experiments.csv
......@@ -116,7 +116,7 @@ def main(experiment_conf, base_dir):
cur_epochs = experiment_conf['epochs']['lower_bound']
upper_bound = experiment_conf['epochs']['upper_bound']
step = upper_bound - cur_epochs / (experiment_conf['epochs']['number_of_steps'] - 1)
step = (upper_bound - cur_epochs) / (experiment_conf['epochs']['number_of_steps'] - 1)
setups = []
while cur_epochs <= upper_bound:
......
......@@ -33,7 +33,7 @@ features_num = 2
density = 2 # 1 is low | 2 is high
i_a = 1
i_d = 2
i_d = 3
benign_ratio = 5
data_file = 'normal_distribution_experiments.csv'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment