Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tensorboard io #374

Merged
merged 29 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
1868980
file io console options
Lilferrit Aug 26, 2024
8a346e0
output console io options
Lilferrit Aug 26, 2024
6e043d1
file io options tests
Lilferrit Aug 26, 2024
ee88344
changelog entry
Lilferrit Aug 26, 2024
4da1357
revised changelog
Lilferrit Aug 27, 2024
653deed
file io console options
Lilferrit Aug 26, 2024
837b769
output console io options
Lilferrit Aug 26, 2024
2483d67
file io options tests
Lilferrit Aug 26, 2024
bf14f2b
changelog entry
Lilferrit Aug 26, 2024
1903cbc
revised changelog
Lilferrit Aug 27, 2024
90ef08b
Generate new screengrabs with rich-codex
github-actions[bot] Aug 27, 2024
970adb6
requested changes
Lilferrit Aug 29, 2024
77c6756
merge conflicts
Lilferrit Aug 29, 2024
e68858b
updated integration test
Lilferrit Aug 30, 2024
3d91f81
requested changes
Lilferrit Aug 30, 2024
645a33f
Generate new screengrabs with rich-codex
github-actions[bot] Aug 30, 2024
2d6dd00
requested changes, output setup refactor
Lilferrit Sep 3, 2024
66de213
Merge branch 'console-file-io' of github.com:Noble-Lab/casanovo into …
Lilferrit Sep 3, 2024
1ee28be
ModelRunner documentation
Lilferrit Sep 3, 2024
4cb18e1
requested changes, _setup_output unit test
Lilferrit Sep 4, 2024
e36a4c9
write tensorboard to output directory
Lilferrit Sep 5, 2024
503fb86
ModelRunner output root bug fix, setup_model documentation, sequence …
Lilferrit Sep 12, 2024
71dc50c
Generate new screengrabs with rich-codex
github-actions[bot] Sep 12, 2024
6ba9bb3
logging format character
Lilferrit Sep 16, 2024
257a681
Merge branch 'console-file-io' of github.com:Noble-Lab/casanovo into …
Lilferrit Sep 16, 2024
4ec76c2
write tensorboard to output directory
Lilferrit Sep 5, 2024
f3169d6
Merge branch 'tensorboard-io' of github.com:Noble-Lab/casanovo into t…
Lilferrit Sep 16, 2024
fa8ee9a
Generate new screengrabs with rich-codex
github-actions[bot] Sep 16, 2024
f9b0895
config file merge conflict
Lilferrit Sep 16, 2024
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 casanovo/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class Config:
max_length=int,
residues=dict,
n_log=int,
tb_summarywriter=str,
tb_summarywriter=bool,
train_label_smoothing=float,
warmup_iters=int,
cosine_schedule_period_iters=int,
Expand Down
4 changes: 2 additions & 2 deletions casanovo/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ random_seed: 454
# OUTPUT OPTIONS
# Logging frequency in training steps.
n_log: 1
# Tensorboard directory to use for keeping track of training metrics.
tb_summarywriter:
# Whether to create tensorboard directory
tb_summarywriter: false
# Model validation and checkpointing frequency in training steps.
val_check_interval: 50_000

Expand Down
15 changes: 13 additions & 2 deletions casanovo/denovo/model_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"""Initialize a ModelRunner"""
self.config = config
self.model_filename = model_filename
self.output_dir = output_dir

# Initialized later:
self.tmp_dir = None
Expand Down Expand Up @@ -268,6 +269,16 @@
Determines whether to set the model up for model training or
evaluation / inference.
"""
tb_summarywriter = None
if self.config.tb_summarywriter:
if self.output_dir is None:
logger.warning(

Check warning on line 275 in casanovo/denovo/model_runner.py

View check run for this annotation

Codecov / codecov/patch

casanovo/denovo/model_runner.py#L275

Added line #L275 was not covered by tests
"Can not create tensorboard because the output directory "
"is not set in the model runner."
)
else:
tb_summarywriter = self.output_dir / "tensorboard"

model_params = dict(
dim_model=self.config.dim_model,
n_head=self.config.n_head,
Expand All @@ -284,7 +295,7 @@
n_beams=self.config.n_beams,
top_match=self.config.top_match,
n_log=self.config.n_log,
tb_summarywriter=self.config.tb_summarywriter,
tb_summarywriter=tb_summarywriter,
train_label_smoothing=self.config.train_label_smoothing,
warmup_iters=self.config.warmup_iters,
cosine_schedule_period_iters=self.config.cosine_schedule_period_iters,
Expand All @@ -303,7 +314,7 @@
min_peptide_len=self.config.min_peptide_len,
top_match=self.config.top_match,
n_log=self.config.n_log,
tb_summarywriter=self.config.tb_summarywriter,
tb_summarywriter=tb_summarywriter,
train_label_smoothing=self.config.train_label_smoothing,
warmup_iters=self.config.warmup_iters,
cosine_schedule_period_iters=self.config.cosine_schedule_period_iters,
Expand Down
Loading