Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debugging md snapshot #68

Open
wants to merge 50 commits into
base: mm_debugging
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
ba97e97
debugging md snapshot
yuanqing-wang Mar 4, 2021
bf630eb
subtract nonbonded
yuanqing-wang Mar 10, 2021
a4f50dc
class-ii energy
yuanqing-wang Mar 15, 2021
a0b72c5
qm scripts
yuanqing-wang Mar 16, 2021
e54ee00
class_ii
yuanqing-wang Mar 16, 2021
d6c609b
carry ii
yuanqing-wang Mar 16, 2021
3b75aad
graphs
yuanqing-wang Mar 16, 2021
2a9e22b
data md
yuanqing-wang Mar 16, 2021
8082cea
class ii running
yuanqing-wang Mar 16, 2021
a9c10b4
sum up class-ii energy
yuanqing-wang Mar 16, 2021
2e29ac0
janossy class-ii scripts
yuanqing-wang Mar 17, 2021
bf27e27
training scripts
yuanqing-wang Mar 17, 2021
1faa9d3
typo correction
yuanqing-wang Mar 17, 2021
4867775
Update legacy_force_field.py
yuanqing-wang Mar 17, 2021
bec8e14
varying snapshot scripts
yuanqing-wang Mar 20, 2021
427229b
Merge branch 'janossy' of https://github.com/choderalab/espaloma into…
yuanqing-wang Mar 20, 2021
5862a28
coefficient
yuanqing-wang Mar 29, 2021
4f95828
alkethoh
yuanqing-wang Mar 29, 2021
6a72523
Merge pull request #69 from choderalab/fix_coeff
yuanqing-wang Mar 30, 2021
465cbec
coefficients for linear mixture
yuanqing-wang Mar 30, 2021
e51647f
gaff param
yuanqing-wang Mar 30, 2021
0aa5218
conflict fix
yuanqing-wang Mar 30, 2021
25cfc35
Merge pull request #70 from choderalab/janossy
yuanqing-wang Mar 31, 2021
26942a4
unit test on consistency between linear mixture and original
yuanqing-wang Mar 31, 2021
4bca83b
Merge pull request #71 from choderalab/fix_coeff
yuanqing-wang Mar 31, 2021
e84310d
linear basis
yuanqing-wang Mar 31, 2021
33317c4
Merge branch 'janossy' of https://github.com/choderalab/espaloma into…
yuanqing-wang Mar 31, 2021
57df159
md17 experiments
yuanqing-wang Apr 8, 2021
f01e763
md17
yuanqing-wang Apr 8, 2021
ab13b4d
md17 submission
yuanqing-wang Apr 9, 2021
b3c4c9b
Merge branch 'janossy_ii' into janossy
yuanqing-wang Apr 10, 2021
5de8fc3
md17 scripts
yuanqing-wang Apr 10, 2021
78fafdb
energy
yuanqing-wang Apr 10, 2021
67f6db4
conflict fix
yuanqing-wang Apr 10, 2021
1c7888c
minimum fitting
yuanqing-wang Apr 13, 2021
b77c5af
c7o2h10 preceiving chemical species
yuanqing-wang Apr 16, 2021
34dc291
undo run script
yuanqing-wang Apr 16, 2021
580c202
grab c7o2h10
yuanqing-wang Apr 16, 2021
9ab3793
subtract
yuanqing-wang Apr 18, 2021
ea1564c
rename
yuanqing-wang Apr 19, 2021
2ab6dba
Update grab.py
yuanqing-wang Apr 19, 2021
3719926
grab
yuanqing-wang Apr 19, 2021
c76ac07
grab ani
yuanqing-wang Apr 20, 2021
51e0ca6
dataset backup
yuanqing-wang Apr 20, 2021
2af2f12
Merge branch 'c7h10o2_data' of https://github.com/choderalab/espaloma…
yuanqing-wang Apr 20, 2021
1fe0a06
update
yuanqing-wang Apr 21, 2021
601cd0d
Merge pull request #73 from choderalab/c7h10o2_data
yuanqing-wang Apr 21, 2021
1230a67
grab
yuanqing-wang Apr 21, 2021
92d7639
Merge pull request #75 from choderalab/c7h10o2_data
yuanqing-wang Apr 21, 2021
9304d3f
energy ii debug
yuanqing-wang Apr 26, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions espaloma/app/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def __init__(
n_epochs=100,
record_interval=1,
normalize=esp.data.normalize.ESOL100LogNormalNormalize,
scheduler=None,
device=torch.device("cpu"),
):
super(Train, self).__init__()
Expand All @@ -82,6 +83,7 @@ def __init__(
self.record_interval = record_interval
self.normalize = normalize()
self.states = {}
self.scheduler = scheduler

# make optimizer
if callable(optimizer):
Expand Down Expand Up @@ -111,6 +113,7 @@ def train_once(self):
retain_graph=False

g = g.to(self.device)
self.net.train()

def closure(g=g):
self.optimizer.zero_grad()
Expand All @@ -125,7 +128,11 @@ def closure(g=g):
raise RuntimeError("Loss is Nan.")
return loss

self.optimizer.step(closure)
loss = closure()
self.optimizer.step()

if self.scheduler is not None:
self.scheduler.step(loss)

def train(self):
""" Train the model for multiple steps and
Expand Down Expand Up @@ -209,7 +216,7 @@ def test(self):
# load the state dict
self.net.load_state_dict(state)

# local scope
self.net.eval()

for metric in self.metrics:
assert isinstance(metric, esp.metrics.Metric)
Expand Down Expand Up @@ -264,6 +271,7 @@ def __init__(
n_epochs=100,
record_interval=1,
device=torch.device("cpu"),
scheduler=None,
):

# bookkeeping
Expand All @@ -278,6 +286,7 @@ def __init__(
self.metrics_te = metrics_te
self.normalize = normalize
self.record_interval = record_interval
self.scheduler = scheduler

def __str__(self):
_str = ""
Expand Down Expand Up @@ -313,6 +322,7 @@ def run(self):
normalize=self.normalize,
device=self.device,
record_interval=self.record_interval,
scheduler=self.scheduler,
)

train.train()
Expand Down
Loading