Skip to content

Use thermo and energy errors in loss function - #209

Merged
mattwthompson merged 31 commits into
mainfrom
merge-thermo-energy
Nov 13, 2026
Merged

mattwthompson merged 31 commits into
mainfrom
merge-thermo-energy

Conversation

@mattwthompson

@mattwthompson mattwthompson commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Closes #208
Closes #213
Closes #226

Part of #148

Comment thread examples/mvp/run.py Resolved
@codecov-commenter

codecov-commenter commented Oct 27, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 48.21429% with 29 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.15%. Comparing base (ae11c3b) to head (d64c087).

Files with missing lines Patch % Lines
tyff/compute/_openmm.py 39.13% 14 Missing ⚠️
tyff/compute/_produce.py 14.28% 6 Missing ⚠️
tyff/compute/_equilibrate.py 20.00% 4 Missing ⚠️
tyff/compute/_minimize.py 66.66% 2 Missing ⚠️
tyff/compute/workflow.py 66.66% 2 Missing ⚠️
tyff/targets/new_thermo.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #209      +/-   ##
==========================================
+ Coverage   82.11%   82.15%   +0.04%     
==========================================
  Files          58       59       +1     
  Lines        5311     5323      +12     
==========================================
+ Hits         4361     4373      +12     
  Misses        950      950              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

mattwthompson and others added 2 commits October 27, 2026 13:51
Co-authored-by: Lily Wang <31115101+lilyminium@users.noreply.github.com>
@mattwthompson

Copy link
Copy Markdown
Member Author

With the code at 8de767f I can run three epocs with the loss function slowly decreasing (as calculated) considering both thermo and energy targets (not entirely validated)

#213 needs to be resolved before considering this complete, though, and I'll need to re-run

@mattwthompson
mattwthompson added this pull request to stack #221 November 10, 2026 17:28
@mattwthompson
mattwthompson marked this pull request as ready for review November 11, 2026 16:47
@mattwthompson

mattwthompson commented Nov 11, 2026 •

Copy link
Copy Markdown
Member Author

After applying several fixes (using the correct reference force field, getting each loss component roughly of similar magnitude, pressure handling #215, respecting SMILES mapping #219 (comment), and likely more I'm forgetting) I'm still seeing the loss grow in the first few iterations:

EPOCH 0: loss=19.721139
	loss component energy (after applying COEFFICIENTS={'energy': 0.1, 'force': 0.01, 'thermo': 100000.0}
	energy 4.219335556030273
	force 2.288978872135019
	thermo 13.212824719124328
EPOCH 1: loss=23.258530
	loss component energy (after applying COEFFICIENTS={'energy': 0.1, 'force': 0.01, 'thermo': 100000.0}
	energy 4.227046966552734
	force 2.2833941983519064
	thermo 16.748089025622193
EPOCH 2: loss=25.659948
	loss component energy (after applying COEFFICIENTS={'energy': 0.1, 'force': 0.01, 'thermo': 100000.0}
	energy 4.232955455780029
	force 2.280235880638339
	thermo 19.146756829684364

This could easily be because of

  • dhvap/dhmix not being incorporated
  • re-running all simulations each epoch with no shortcuts/re-sampling/etc.
  • equilibration and sampling times being very very small
  • uncertainty not being accounted for

or simply expected behavior given the very small number of iterations


Update: Running it a bit more, it seems like the behavior is neither ideal nor optimally bad, which in this scope feels good enough:

EPOCH 0: loss=19.721139
	loss component energy (after applying COEFFICIENTS={'energy': 0.1, 'force': 0.01, 'thermo': 100000.0})
	energy 4.219335556030273
	force 2.288978872135019
	thermo 13.212824719124328
EPOCH 1: loss=23.277236
	loss component energy (after applying COEFFICIENTS={'energy': 0.1, 'force': 0.01, 'thermo': 100000.0})
	energy 4.234147548675537
	force 2.2949994226426402
	thermo 16.748089025622193
EPOCH 2: loss=25.690416
	loss component energy (after applying COEFFICIENTS={'energy': 0.1, 'force': 0.01, 'thermo': 100000.0})
	energy 4.2439494132995605
	force 2.299709611384476
	thermo 19.146756829684364
EPOCH 3: loss=19.928845
	loss component energy (after applying COEFFICIENTS={'energy': 0.1, 'force': 0.01, 'thermo': 100000.0})
	energy 4.252472400665283
	force 2.3041207905795678
	thermo 13.372252127332729
EPOCH 4: loss=23.636336
	loss component energy (after applying COEFFICIENTS={'energy': 0.1, 'force': 0.01, 'thermo': 100000.0})
	energy 4.25861120223999
	force 2.3058810113260924
	thermo 17.071844071399056
EPOCH 5: loss=22.374276
	loss component energy (after applying COEFFICIENTS={'energy': 0.1, 'force': 0.01, 'thermo': 100000.0})
	energy 4.262715816497803
	force 2.3058808461727764
	thermo 15.805679609410818
EPOCH 6: loss=31.239997
	loss component energy (after applying COEFFICIENTS={'energy': 0.1, 'force': 0.01, 'thermo': 100000.0})
	energy 4.266695499420166
	force 2.306119460100159
	thermo 24.667181566169205
EPOCH 7: loss=16.541983
	loss component energy (after applying COEFFICIENTS={'energy': 0.1, 'force': 0.01, 'thermo': 100000.0})
	energy 4.2703070640563965
	force 2.3067892802177674
	thermo 9.964886455025024
EPOCH 8: loss=12.080359
	loss component energy (after applying COEFFICIENTS={'energy': 0.1, 'force': 0.01, 'thermo': 100000.0})
	energy 4.273726940155029
	force 2.307612904638319
	thermo 5.499019234473934
EPOCH 9: loss=12.896108
	loss component energy (after applying COEFFICIENTS={'energy': 0.1, 'force': 0.01, 'thermo': 100000.0})
	energy 4.275704860687256
	force 2.3072598936003312
	thermo 6.31314277199202

@mattwthompson
mattwthompson removed this pull request from stack #221 November 11, 2026 21:35
@mattwthompson
mattwthompson marked this pull request as draft November 11, 2026 21:47
@mattwthompson
mattwthompson marked this pull request as ready for review November 12, 2026 16:28

@lilyminium lilyminium left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple minor comments but otherwise LGTM! I could reproduce locally. I did run into some ManagerLostErrors but they seemed sporadic and went away when I reran.

Comment thread tyff/compute/configs.py Resolved
Comment thread tyff/compute/workflow.py Resolved
@mattwthompson
mattwthompson merged commit 32badc2 into main Nov 13, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shut down Parsl processes after each epoch More issues with pressure Merge thermo and energy targets in MVP example

3 participants