Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mace/cli/run_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,7 @@ def run(args) -> None:
for head_config in head_configs:
if all(check_path_ase_read(f) for f in head_config.train_file):
for name, subset in head_config.collections.tests:
test_sets[name] = [
test_sets[head_config.head_name + "_" + name] = [
data.AtomicData.from_config(
config, z_table=z_table, cutoff=args.r_max, heads=heads
)
Expand Down
11 changes: 4 additions & 7 deletions mace/cli/visualise_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,10 @@ def plot_inference_from_results(

fixed_color_test = colors[2] # Color for test dataset

# Plot test data (single legend entry)
# Plot test data (single legend entry per head)
for name, result in test_dict.items():
if head not in name:
continue
# Initialize scatter to None to avoid possibly used before assignment
scatter = None

Expand All @@ -396,7 +398,6 @@ def plot_inference_from_results(
result[e_key]["predicted_per_atom"],
marker="o",
color=fixed_color_test,
label="Test",
)

elif key == "force" and "forces" in result:
Expand All @@ -405,7 +406,6 @@ def plot_inference_from_results(
result["forces"]["predicted"],
marker="o",
color=fixed_color_test,
label="Test",
)

elif key == "stress" and "stress" in result:
Expand All @@ -414,7 +414,6 @@ def plot_inference_from_results(
result["stress"]["predicted"],
marker="o",
color=fixed_color_test,
label="Test",
)

elif key == "virials" and "virials" in result:
Expand All @@ -423,7 +422,6 @@ def plot_inference_from_results(
result["virials"]["predicted_per_atom"],
marker="o",
color=fixed_color_test,
label="Test",
)

elif key == "dipole" and "dipole" in result:
Expand All @@ -432,12 +430,11 @@ def plot_inference_from_results(
result["dipole"]["predicted_per_atom"],
marker="o",
color=fixed_color_test,
label="Test",
)

# Only add to legend_labels if scatter was assigned
if scatter is not None:
legend_labels["Test"] = scatter
legend_labels[f"Test {head}"] = scatter

# Add diagonal line for guide
min_val = min(ax.get_xlim()[0], ax.get_ylim()[0])
Expand Down
Loading