-
Notifications
You must be signed in to change notification settings - Fork 7
Add Scaled Sigmoid Link and Generic Inverse #80
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces two new scaled sigmoid link functions and a generic inverse link to facilitate function inversion.
- Added ScaledInverseSigmoidLink and ScaledSigmoidLink in sigmoidlinks.py with methods for the link, its inverse, and corresponding derivatives.
- Introduced a GenericInverseLink in generic.py to swap the link functions and derivatives.
- Updated init.py files to expose the new link functions and the GenericInverseLink.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/rolch/link/sigmoidlinks.py | Added implementations for two scaled sigmoid links with their respective methods. |
| src/rolch/link/generic.py | Added a GenericInverseLink class to invert provided link functions. |
| src/rolch/link/init.py | Updated module exports to include the new sigmoid links and generic inverse link. |
| src/rolch/init.py | Updated package exports to include the new link functions. |
Comments suppressed due to low confidence (2)
src/rolch/link/sigmoidlinks.py:38
- In ScaledInverseSigmoidLink.inverse_derivative, the multiplication by (self.upper - self.lower) and subsequent division by (self.upper - self.lower) cancel each other out. Simplify the expression to 'sigmoid(x) * (1 - sigmoid(x))' for clarity.
* (1 - sigmoid(x)) / (self.upper - self.lower)
src/rolch/link/sigmoidlinks.py:80
- In ScaledSigmoidLink.link_derivative, the factor (self.upper - self.lower) is multiplied then divided by the same term, resulting in redundancy. Consider simplifying the derivative to eliminate the unnecessary operations.
* (1 - sigmoid(x)) / (self.upper - self.lower)
|
|
||
| Args: | ||
| link_function (LinkFunction): The Link function to invert | ||
| link_support (Tuple): The support of the link function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is misleading, we want to pass the support of the inverted link function here, right?
| link_support (Tuple): The support of the link function | |
| link_support (Tuple): The support of the inverted link function |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
This is a great Idea! However, before merging this I'd like to make the following changes:
For now, we should move this into the draft stage IMHO. |
No description provided.