Skip to content

Commit

Permalink
Add warning for missing val_loss
Browse files Browse the repository at this point in the history
  • Loading branch information
SCiarella committed Nov 3, 2024
1 parent 27d0dd4 commit e73cc0b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/speckcn2/loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ def __init__(self,
validation: bool = False):
super(ComposableLoss, self).__init__()
if validation:
config['loss'] = config['val_loss']
if 'val_loss' in config:
config['loss'] = config['val_loss']
else:
print('[!] Warning: Validation loss not found in config.yaml,',
'keeping track of training loss instead')
self.device = device
self.loss_functions: dict[str, Callable] = {
'MSE': torch.nn.MSELoss(),
Expand Down

0 comments on commit e73cc0b

Please sign in to comment.