Skip to content

Rewrite the LatentAnchor and Geometry Penalty into reward. #363

Description

@smallfishabc

From review on #313, Marcus asked for two changes to how IT-opt's regularizers are written.

Move LatentAnchor into core/rewards/ — it currently sits in core/scalers/latent_optimization.py:99. It is regularization in the form of a reward, so it belongs with the other rewards where it is reusable and can be combined with them (comment). Blocker: its input is latents, not coordinates, so it does not fit RewardFunctionProtocol as written — the protocol has to admit latent-space terms first.

Flip BondGeometryReward to a reward to be maximized — core/rewards/geometry.py:60. It is written as a penalty today, and a term that only works when minimized won't compose with the other rewards (comment).

Note before doing this: RealSpaceDensityReward returns an L1/MSE loss (core/rewards/real_space_density.py:221-223) and is minimized, so the package's existing "rewards" are really losses. Flipping only the geometry term puts the two on opposite signs — pick one convention for the whole package.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions