Skip to content

Commit

Permalink
Fix unused strings
Browse files Browse the repository at this point in the history
  • Loading branch information
DubiousCactus committed May 31, 2024
1 parent d7327af commit 59ce5f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/base_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def test(self, visualize_every: int = 0, **kwargs):
self._pbar.reset()
self._pbar.set_description("Testing")
color_code = project_conf.ANSI_COLORS[project_conf.Theme.TESTING.value]
" ==================== Training loop for one epoch ==================== "
""" ==================== Training loop for one epoch ==================== """
for i, batch in enumerate(self._data_loader):
if not self._running:
print("[!] Testing aborted.")
Expand All @@ -99,7 +99,7 @@ def test(self, visualize_every: int = 0, **kwargs):
f"Testing [loss={test_loss.compute():.4f}]",
color_code,
)
" ==================== Visualization ==================== "
""" ==================== Visualization ==================== """
if visualize_every > 0 and (i + 1) % visualize_every == 0:
self._visualize(batch, i)

Expand Down
10 changes: 5 additions & 5 deletions src/base_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def _train_epoch(
self._pbar.set_description(description)
color_code = project_conf.ANSI_COLORS[project_conf.Theme.TRAINING.value]
has_visualized = 0
" ==================== Training loop for one epoch ==================== "
""" ==================== Training loop for one epoch ==================== """
for i, batch in enumerate(self._train_loader):
if (
not self._running
Expand Down Expand Up @@ -178,7 +178,7 @@ def _val_epoch(self, description: str, visualize: bool, epoch: int) -> float:
"""
has_visualized = 0
color_code = project_conf.ANSI_COLORS[project_conf.Theme.VALIDATION.value]
"==================== Validation loop for one epoch ===================="
""" ==================== Validation loop for one epoch ==================== """
with torch.no_grad():
val_loss: MeanMetric = MeanMetric()
val_loss_components: Dict[str, MeanMetric] = defaultdict(MeanMetric)
Expand All @@ -204,7 +204,7 @@ def _val_epoch(self, description: str, visualize: bool, epoch: int) -> float:
+ f" min_val_loss={self._model_saver.min_val_loss:.4f}]",
color_code,
)
" ==================== Visualization ==================== "
""" ==================== Visualization ==================== """
if (
visualize
and has_visualized < self._viz_n_samples
Expand Down Expand Up @@ -262,7 +262,7 @@ def train(
self._viz_n_samples = visualize_n_samples
train_losses: List[float] = []
val_losses: List[float] = []
" ==================== Training loop ==================== "
""" ==================== Training loop ==================== """
for epoch in range(self._epoch, epochs):
self._epoch = epoch # Update for the model saver
if not self._running:
Expand Down Expand Up @@ -292,7 +292,7 @@ def train(
)
if self._scheduler is not None:
self._scheduler.step()
" ==================== Plotting ==================== "
""" ==================== Plotting ==================== """
if project_conf.PLOT_ENABLED:
self._plot(epoch, train_losses, val_losses)
self._pbar.close()
Expand Down

0 comments on commit 59ce5f0

Please sign in to comment.