Esempio n. 1
0
 def emergency_read_checkpoint(self):
     import glob
     for name, the_net in self.checkpoint_names.items():
         if isinstance(the_net, torch.nn.DataParallel):
             the_net = the_net.module
         files = glob.glob(f"{self.ctx.path}-{name}-epoch-*.torch")
         files = sorted(files,
                        key=lambda x: int(x.split("-")[-1].split(".")[0]))
         target = files[-1]
         netread(the_net, target)
Esempio n. 2
0
import sys
import os
import time
from pyrosetta import *

from torchsupport.data.io import netread

from protsupport.protocols.minimization_packing.design import (
    NetPackMover, AnnealedNetPackMover)
from protsupport.modules.baseline import Baseline

if __name__ == "__main__":
    init("-mute all")
    pose = pose_from_file(sys.argv[1])
    net = Baseline(aa_size=20, in_size=39, hidden_size=100, neighbours=15)
    netread(net, sys.argv[3])
    net.eval()
    fixed_path = sys.argv[2]
    with open(fixed_path) as fx:
        fix_list = []
        for line in fx:
            fix_list.append(int(line.strip()))
        fix_list = sorted(list(set(fix_list)))
    scorefxn = get_fa_scorefxn()
    mover = NetPackMover(net,
                         pose,
                         fix=fix_list,
                         glycinate=True,
                         scorefxn=scorefxn,
                         kT=0.1,
                         max_iter=1000)