Skip to content

Conversation

@starryendymion
Copy link

Fix Numerical Instability (NaNs) and Deprecated Functions in Physics Informed Super Resolution

Description

This PR addresses critical stability issues in the DeepLense_Physics_Informed_Super_Resolution_Anirudh_Shankar project. Specifically, it prevents potential NaN values (division by zero) that occur during normalization when an input image or feature map is uniform (i.e., max == min).

It also modernizes the codebase by replacing deprecated PyTorch functions that may cause warnings or errors in newer versions.

Changes

  • Fixed Division by Zero: Added a small epsilon (1e-8) to the denominator during Min-Max normalization in fGAN/data.py and fGAN/models.py.
  • Removed Deprecated Code: Replaced torch.nn.functional.sigmoid with torch.sigmoid in fGAN/models.py.

- Added epsilon (1e-8) to normalization in data.py and models.py to prevent crash on uniform images.
- Replaced deprecated torch.nn.functional.sigmoid with torch.sigmoid.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant