Commit 0005f75a authored by Martin Řepa's avatar Martin Řepa

Use while instead of for in learning_epochs

parent 64f00398
......@@ -63,7 +63,9 @@ def get_configuration() -> dict:
def exec_new_setup(conf: RootConfig, folder: str, iterations: int) -> Setup:
cur_epochs = conf.model_conf.defender_conf.nn_conf.epochs
sub_results = []
for i in range(iterations):
i = 0
while i < iterations:
if not os.path.exists(f'{folder}/{i}'):
os.mkdir(f'{folder}/{i}')
......@@ -74,7 +76,6 @@ def exec_new_setup(conf: RootConfig, folder: str, iterations: int) -> Setup:
time_taken = time.time() - start
if result.iterations == 1:
i -= 1
continue
attacker_actions = []
......@@ -103,6 +104,8 @@ def exec_new_setup(conf: RootConfig, folder: str, iterations: int) -> Setup:
attacker_actions,
defender_actions)
sub_results.append(sub_result)
i += 1
return Setup(cur_epochs, sub_results)
......
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