Skip to content

Commit

Permalink
Adding changes to consider all metrics.
Browse files Browse the repository at this point in the history
  • Loading branch information
rballeba committed Sep 13, 2024
1 parent 3619832 commit 94197cc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
15 changes: 13 additions & 2 deletions code/experiments/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,20 @@ def test_all(
number_of_barycentric_subdivisions=number_of_barycentric_subdivisions,
)

# Modify output metric keys to contemplate the number of barycentric subdivisions
out_processed = (
dict()
) # The dict will contain the processed metrics for all barycentric subdivisions.
# We assume that we always use one test dataloader when testing.
for idx in range(
number_of_barycentric_subdivisions + 1
): # Each metric is repeated for each
# barycentric subdivision
for key in out[idx][0].keys():
out_processed[f"{key}_bs_{idx}"] = out[idx][0][key]

# add benchmarking results
results.add(data=[out[idx][0] for idx in range(number_of_barycentric_subdivisions + 1)],
config=config) # TODO: Make sure that the behaviour associated to this call is updated accordingly
results.add(data=out_processed, config=config)
results.save(".ignore_temp")

results.save("results")
Expand Down
2 changes: 1 addition & 1 deletion code/experiments/utils/result_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def save(self, t_file_prefix: str = "res"):
result = x.data
result["type_model"] = x.config.conf_model.type.name.lower()
result["transform"] = x.config.transforms.name.lower()
data.append(x.data)
data.append(result)

df = pd.DataFrame(data)
df.to_csv(t_file, index=False)

0 comments on commit 94197cc

Please sign in to comment.