lnccbrown / lnccbrown/LANfactory
Dissociate CPN / OPN cleanly
- Dominant language
- Python
- Stars
- 16
- Forks
- 4
- Avg merge
- 3d 7h
- Merged PRs (30d)
- 8
Description
Both the torch and the jax pipeline have the following decision rule applied for the `network_type` setting.
Torch:
```
if network_type is not None:
self.network_type = network_type
else:
self.network_type = "lan" if self.train_output_type == "logprob" else "cpn"
print(
'Setting network type to "lan" or "cpn" based on train_output_type. \n'
+ "Note: This is only a default setting, and can be overwritten by the network_type argument."
)
```
Jax:
```
# Identify network type:
if self.model.train_output_type == "logprob":
network_type = "lan"
elif self.model.train_output_type == "logits":
network_type = "cpn"
else:
network_type = "unknown"
print(
'Model type identified as "unknown" because '
"the training_output_type attribute"
' of the supplied jax model is neither "logprob", nor "logits"'
)
```
Anchoring on the `train_output_type` is the basic mistake. Since both the `cpn` and the `opn` networks have `train_output_type="logits"`.
This needs a slight refactor with new logic. Possibly not "identify"/"deduce" a name for the `network_type` and instead just pass that actively.
**Note**:
For backward compatibility, the previous (current) logic might need to be kept around.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the torch and jax pipeline code that applies the `network_type` decision rules, then compare how `cpn` and `opn` models are represented when both use `train_output_type="logits"`. Define and verify the new explicit network-type flow, including the backward-compatibility requirement noted in the issue. Done means cpn and opn are no longer conflated by train_output_type in both pipelines.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100