Commit b79b849
Remove activation on final layer of KeyNet and ICNN (#702)
* Remove activation on final layer of KeyNet and ICNN
The output layer of both KeyNet.gradient and ICNN.__call__ previously
applied the activation function (default ReLU) after the final layer.
This forced the outputs to be non-negative: KeyNet's predicted vectors
could not take signed values, and ICNN's scalar potential was clamped to
be non-negative.
Make the final layer linear in both networks. Convexity of the ICNN
output is preserved (a non-negatively weighted combination of convex
features remains convex).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix: yapf formatting + linen potential in cmonge_gap test
Reformat the final-layer loop in ICNN/KeyNet to satisfy yapf (the CI
"code" Lint check). Switch conditional_monge_gap_test to LinenPotentialMLP
so it uses the linen init/apply API it was written for, matching
monge_gap_test (the nnx PotentialMLP now requires input_dim/rngs).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent f959b2a commit b79b849
2 files changed
Lines changed: 17 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
233 | 236 | | |
234 | 237 | | |
235 | 238 | | |
| |||
399 | 402 | | |
400 | 403 | | |
401 | 404 | | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
407 | 413 | | |
408 | 414 | | |
409 | 415 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
210 | | - | |
| 210 | + | |
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
| |||
0 commit comments