mHCConnector.alpha is unused in its own forward() — applied externally in model.py #14

Open
opened 2026-05-09 07:30:22 +02:00 by sleepy · 0 comments
Owner

Problem

mHCConnector.alpha is defined as a parameter (mhc.py:25) but never used in mHCConnector.forward(). The alpha scaling is applied externally in model.py:123:

# model.py — alpha applied OUTSIDE the connector
h_in = streams * connector.alpha.view(1, 1, connector.M, 1)
# ... then later:
streams = connector(streams, f_out)  # connector never sees alpha

The connector's forward() only uses self.A and self.beta. The alpha parameter exists but the connector itself doesn't use it.

Impact

  • API is confusing: alpha is a parameter of the connector but applied externally
  • If someone uses mHCConnector standalone, alpha won't be applied
  • The docstring says the connector handles pre-scaling but it doesn't

Action needed

  • Move alpha scaling into mHCConnector.forward(), OR
  • Remove alpha from the connector and document it as an external concern

Files

  • tergent/mhc.py:25, 38-47
  • tergent/model.py:123
## Problem `mHCConnector.alpha` is defined as a parameter (mhc.py:25) but **never used** in `mHCConnector.forward()`. The alpha scaling is applied externally in `model.py:123`: ```python # model.py — alpha applied OUTSIDE the connector h_in = streams * connector.alpha.view(1, 1, connector.M, 1) # ... then later: streams = connector(streams, f_out) # connector never sees alpha ``` The connector's `forward()` only uses `self.A` and `self.beta`. The `alpha` parameter exists but the connector itself doesn't use it. ## Impact - API is confusing: `alpha` is a parameter of the connector but applied externally - If someone uses `mHCConnector` standalone, alpha won't be applied - The docstring says the connector handles pre-scaling but it doesn't ## Action needed - Move alpha scaling into `mHCConnector.forward()`, OR - Remove `alpha` from the connector and document it as an external concern ## Files - `tergent/mhc.py:25, 38-47` - `tergent/model.py:123`
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sleepy/ternary#14
No description provided.