Skip to content

Conversation

@kamilansri
Copy link

Summary

This PR fixes a critical logic error in the SISR model's residual layers and optimizes memory usage during the forward pass.

Changes

  • Critical Fix: Removed the final ReLU activation in make_residual_layer.

    • Reasoning: Residual blocks must compute x + Residual(x). If the residual path ends in a ReLU, it can only add positive values to the signal, severely limiting the network's capacity to learn.
  • Optimization: Removed x.clone() calls in the forward method.

    • Reasoning: PyTorch layers generate new tensors; explicitly cloning input tensors before passing them to layers is redundant and increases VRAM usage unnecessarily.
  • Refactoring: Updated super(SISR, self).__init__() to the modern Python 3 super().__init__() syntax.

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