Skip to content

Commit

Permalink
Rename save_visualizations to view_visualizations for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
hajin-park committed Jun 21, 2024
1 parent 36cdba2 commit d949fda
Show file tree
Hide file tree
Showing 28 changed files with 152 additions and 232 deletions.
4 changes: 2 additions & 2 deletions sleap/nn/config/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class OutputsConfig:
tags: A list of strings to use as "tags" that can be used to organize multiple
runs. These are not used for anything during training or inference, so they
can be used to store arbitrary user-specified metadata.
save_visualizations: If True, will render and save visualizations of the model
view_visualizations: If True, will render and save visualizations of the model
predictions as PNGs to "{run_folder}/viz/{split}.{epoch:04d}.png", where the
split is one of "train", "validation", "test".
delete_viz_images: If True, delete the saved visualizations after training
Expand All @@ -169,7 +169,7 @@ class OutputsConfig:
run_name_suffix: Optional[Text] = None
runs_folder: Text = "models"
tags: List[Text] = attr.ib(factory=list)
save_visualizations: bool = True
view_visualizations: bool = True
delete_viz_images: bool = True
zip_outputs: bool = False
log_to_csv: bool = True
Expand Down
6 changes: 3 additions & 3 deletions sleap/nn/training.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ def setup_visualization(
"This probably means Qt is running headless."
)

if config.save_visualizations and config.save_outputs:
if config.view_visualizations and config.save_outputs:
callbacks.append(
MatplotlibSaver(
save_folder=os.path.join(run_path, "viz"), plot_fn=viz_fn, prefix=name
Expand Down Expand Up @@ -945,7 +945,7 @@ def train(self):
# Run post-training actions.
if self.config.outputs.save_outputs:
if (
self.config.outputs.save_visualizations
self.config.outputs.view_visualizations
and self.config.outputs.delete_viz_images
):
self.cleanup()
Expand Down Expand Up @@ -1948,7 +1948,7 @@ def create_trainer_using_cli(args: Optional[List] = None):
job_config.outputs.run_name_prefix = args.prefix
if args.suffix != "":
job_config.outputs.run_name_suffix = args.suffix
job_config.outputs.save_visualizations |= args.save_viz
job_config.outputs.view_visualizations |= args.save_viz
if args.labels_path == "":
args.labels_path = None
args.video_paths = args.video_paths.split(",")
Expand Down
10 changes: 5 additions & 5 deletions sleap/training_profiles/baseline.centroid.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@
"learning_rate_schedule": {
"reduce_on_plateau": true,
"reduction_factor": 0.5,
"plateau_min_delta": 1e-08,
"plateau_min_delta": 1e-8,
"plateau_patience": 5,
"plateau_cooldown": 3,
"min_learning_rate": 1e-08
"min_learning_rate": 1e-8
},
"hard_keypoint_mining": {
"online_mining": false,
Expand All @@ -104,7 +104,7 @@
},
"early_stopping": {
"stop_training_on_plateau": true,
"plateau_min_delta": 1e-08,
"plateau_min_delta": 1e-8,
"plateau_patience": 20
}
},
Expand All @@ -115,7 +115,7 @@
"run_name_suffix": null,
"runs_folder": "models",
"tags": [],
"save_visualizations": true,
"view_visualizations": true,
"log_to_csv": true,
"checkpointing": {
"initial_model": false,
Expand All @@ -139,4 +139,4 @@
"publish_address": "tcp://127.0.0.1:9001"
}
}
}
}
10 changes: 5 additions & 5 deletions sleap/training_profiles/baseline_large_rf.bottomup.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@
"learning_rate_schedule": {
"reduce_on_plateau": true,
"reduction_factor": 0.5,
"plateau_min_delta": 1e-08,
"plateau_min_delta": 1e-8,
"plateau_patience": 8,
"plateau_cooldown": 3,
"min_learning_rate": 1e-08
"min_learning_rate": 1e-8
},
"hard_keypoint_mining": {
"online_mining": false,
Expand All @@ -113,7 +113,7 @@
},
"early_stopping": {
"stop_training_on_plateau": true,
"plateau_min_delta": 1e-08,
"plateau_min_delta": 1e-8,
"plateau_patience": 10
}
},
Expand All @@ -124,7 +124,7 @@
"run_name_suffix": null,
"runs_folder": "models",
"tags": [],
"save_visualizations": true,
"view_visualizations": true,
"log_to_csv": true,
"checkpointing": {
"initial_model": false,
Expand All @@ -148,4 +148,4 @@
"publish_address": "tcp://127.0.0.1:9001"
}
}
}
}
10 changes: 5 additions & 5 deletions sleap/training_profiles/baseline_large_rf.single.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@
"learning_rate_schedule": {
"reduce_on_plateau": true,
"reduction_factor": 0.5,
"plateau_min_delta": 1e-05,
"plateau_min_delta": 1e-5,
"plateau_patience": 5,
"plateau_cooldown": 3,
"min_learning_rate": 1e-08
"min_learning_rate": 1e-8
},
"hard_keypoint_mining": {
"online_mining": false,
Expand All @@ -104,7 +104,7 @@
},
"early_stopping": {
"stop_training_on_plateau": true,
"plateau_min_delta": 1e-08,
"plateau_min_delta": 1e-8,
"plateau_patience": 10
}
},
Expand All @@ -115,7 +115,7 @@
"run_name_suffix": null,
"runs_folder": "models",
"tags": [],
"save_visualizations": true,
"view_visualizations": true,
"log_to_csv": true,
"checkpointing": {
"initial_model": false,
Expand All @@ -139,4 +139,4 @@
"publish_address": "tcp://127.0.0.1:9001"
}
}
}
}
10 changes: 5 additions & 5 deletions sleap/training_profiles/baseline_large_rf.topdown.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@
"learning_rate_schedule": {
"reduce_on_plateau": true,
"reduction_factor": 0.5,
"plateau_min_delta": 1e-08,
"plateau_min_delta": 1e-8,
"plateau_patience": 5,
"plateau_cooldown": 3,
"min_learning_rate": 1e-08
"min_learning_rate": 1e-8
},
"hard_keypoint_mining": {
"online_mining": false,
Expand All @@ -105,7 +105,7 @@
},
"early_stopping": {
"stop_training_on_plateau": true,
"plateau_min_delta": 1e-08,
"plateau_min_delta": 1e-8,
"plateau_patience": 10
}
},
Expand All @@ -116,7 +116,7 @@
"run_name_suffix": null,
"runs_folder": "models",
"tags": [],
"save_visualizations": true,
"view_visualizations": true,
"log_to_csv": true,
"checkpointing": {
"initial_model": false,
Expand All @@ -140,4 +140,4 @@
"publish_address": "tcp://127.0.0.1:9001"
}
}
}
}
10 changes: 5 additions & 5 deletions sleap/training_profiles/baseline_medium_rf.bottomup.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@
"learning_rate_schedule": {
"reduce_on_plateau": true,
"reduction_factor": 0.5,
"plateau_min_delta": 1e-08,
"plateau_min_delta": 1e-8,
"plateau_patience": 8,
"plateau_cooldown": 3,
"min_learning_rate": 1e-08
"min_learning_rate": 1e-8
},
"hard_keypoint_mining": {
"online_mining": false,
Expand All @@ -113,7 +113,7 @@
},
"early_stopping": {
"stop_training_on_plateau": true,
"plateau_min_delta": 1e-08,
"plateau_min_delta": 1e-8,
"plateau_patience": 10
}
},
Expand All @@ -124,7 +124,7 @@
"run_name_suffix": null,
"runs_folder": "models",
"tags": [],
"save_visualizations": true,
"view_visualizations": true,
"log_to_csv": true,
"checkpointing": {
"initial_model": false,
Expand All @@ -148,4 +148,4 @@
"publish_address": "tcp://127.0.0.1:9001"
}
}
}
}
10 changes: 5 additions & 5 deletions sleap/training_profiles/baseline_medium_rf.single.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@
"learning_rate_schedule": {
"reduce_on_plateau": true,
"reduction_factor": 0.5,
"plateau_min_delta": 1e-08,
"plateau_min_delta": 1e-8,
"plateau_patience": 5,
"plateau_cooldown": 3,
"min_learning_rate": 1e-08
"min_learning_rate": 1e-8
},
"hard_keypoint_mining": {
"online_mining": false,
Expand All @@ -104,7 +104,7 @@
},
"early_stopping": {
"stop_training_on_plateau": true,
"plateau_min_delta": 1e-08,
"plateau_min_delta": 1e-8,
"plateau_patience": 10
}
},
Expand All @@ -115,7 +115,7 @@
"run_name_suffix": null,
"runs_folder": "models",
"tags": [],
"save_visualizations": true,
"view_visualizations": true,
"log_to_csv": true,
"checkpointing": {
"initial_model": false,
Expand All @@ -139,4 +139,4 @@
"publish_address": "tcp://127.0.0.1:9001"
}
}
}
}
10 changes: 5 additions & 5 deletions sleap/training_profiles/baseline_medium_rf.topdown.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@
"learning_rate_schedule": {
"reduce_on_plateau": true,
"reduction_factor": 0.5,
"plateau_min_delta": 1e-08,
"plateau_min_delta": 1e-8,
"plateau_patience": 5,
"plateau_cooldown": 3,
"min_learning_rate": 1e-08
"min_learning_rate": 1e-8
},
"hard_keypoint_mining": {
"online_mining": false,
Expand All @@ -105,7 +105,7 @@
},
"early_stopping": {
"stop_training_on_plateau": true,
"plateau_min_delta": 1e-08,
"plateau_min_delta": 1e-8,
"plateau_patience": 10
}
},
Expand All @@ -116,7 +116,7 @@
"run_name_suffix": null,
"runs_folder": "models",
"tags": [],
"save_visualizations": true,
"view_visualizations": true,
"log_to_csv": true,
"checkpointing": {
"initial_model": false,
Expand All @@ -140,4 +140,4 @@
"publish_address": "tcp://127.0.0.1:9001"
}
}
}
}
10 changes: 5 additions & 5 deletions sleap/training_profiles/pretrained.bottomup.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@
"learning_rate_schedule": {
"reduce_on_plateau": true,
"reduction_factor": 0.5,
"plateau_min_delta": 1e-08,
"plateau_min_delta": 1e-8,
"plateau_patience": 8,
"plateau_cooldown": 3,
"min_learning_rate": 1e-08
"min_learning_rate": 1e-8
},
"hard_keypoint_mining": {
"online_mining": false,
Expand All @@ -110,7 +110,7 @@
},
"early_stopping": {
"stop_training_on_plateau": true,
"plateau_min_delta": 1e-08,
"plateau_min_delta": 1e-8,
"plateau_patience": 10
}
},
Expand All @@ -121,7 +121,7 @@
"run_name_suffix": null,
"runs_folder": "models",
"tags": [],
"save_visualizations": true,
"view_visualizations": true,
"log_to_csv": true,
"checkpointing": {
"initial_model": false,
Expand All @@ -145,4 +145,4 @@
"publish_address": "tcp://127.0.0.1:9001"
}
}
}
}
10 changes: 5 additions & 5 deletions sleap/training_profiles/pretrained.centroid.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@
"learning_rate_schedule": {
"reduce_on_plateau": true,
"reduction_factor": 0.5,
"plateau_min_delta": 1e-08,
"plateau_min_delta": 1e-8,
"plateau_patience": 5,
"plateau_cooldown": 3,
"min_learning_rate": 1e-08
"min_learning_rate": 1e-8
},
"hard_keypoint_mining": {
"online_mining": false,
Expand All @@ -101,7 +101,7 @@
},
"early_stopping": {
"stop_training_on_plateau": true,
"plateau_min_delta": 1e-08,
"plateau_min_delta": 1e-8,
"plateau_patience": 10
}
},
Expand All @@ -112,7 +112,7 @@
"run_name_suffix": null,
"runs_folder": "models",
"tags": [],
"save_visualizations": true,
"view_visualizations": true,
"log_to_csv": true,
"checkpointing": {
"initial_model": false,
Expand All @@ -136,4 +136,4 @@
"publish_address": "tcp://127.0.0.1:9001"
}
}
}
}
Loading

0 comments on commit d949fda

Please sign in to comment.