Update moo.py
Browse files
moo.py
CHANGED
|
@@ -33,17 +33,27 @@ target_sequence = tokenizer(target, return_tensors='pt')['input_ids'].to(device)
|
|
| 33 |
# Load Models
|
| 34 |
solver = load_solver('./ckpt/peptide/cnn_epoch200_lr0.0001_embed512_hidden256_loss3.1051.ckpt', vocab_size, device)
|
| 35 |
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
nonfouling_model
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
|
| 48 |
for i in range(args.n_batches):
|
| 49 |
if source_distribution == "uniform":
|
|
|
|
| 33 |
# Load Models
|
| 34 |
solver = load_solver('./ckpt/peptide/cnn_epoch200_lr0.0001_embed512_hidden256_loss3.1051.ckpt', vocab_size, device)
|
| 35 |
|
| 36 |
+
score_models = []
|
| 37 |
+
if 'Hemolysis' in args.objectives:
|
| 38 |
+
hemolysis_model = HemolysisModel(device=device)
|
| 39 |
+
score_models.append(hemolysis_model)
|
| 40 |
+
if 'Non-Fouling' in args.objectives:
|
| 41 |
+
nonfouling_model = NonfoulingModel(device=device)
|
| 42 |
+
score_models.append(nonfouling_model)
|
| 43 |
+
if 'Solubility' in args.objectives:
|
| 44 |
+
solubility_model = SolubilityModelNew(device=device)
|
| 45 |
+
score_models.append(solubility_model)
|
| 46 |
+
if 'Half-Life' in args.objectives:
|
| 47 |
+
halflife_model = HalfLifeModel(device=device)
|
| 48 |
+
score_models.append(halflife_model)
|
| 49 |
+
if 'Affinity' in args.objectives:
|
| 50 |
+
affinity_predictor = load_affinity_predictor('/scratch/pranamlab/tong/checkpoints/MOG-DFM/classifier_ckpt/binding_affinity_unpooled.pt', device)
|
| 51 |
+
affinity_model = AffinityModel(affinity_predictor, target_sequence)
|
| 52 |
+
score_models.append(affinity_model)
|
| 53 |
+
if 'Motif' in args.objectives or 'Specificity' in args.objectives:
|
| 54 |
+
bindevaluator = load_bindevaluator('/scratch/pranamlab/tong/checkpoints/BindEvaluator/model_path/finetuned_BindEvaluator.ckpt', device)
|
| 55 |
+
motif_model = MotifModel(bindevaluator, target_sequence, motifs, penalty=args.motif_penalty)
|
| 56 |
+
score_models.append(motif_model)
|
| 57 |
|
| 58 |
for i in range(args.n_batches):
|
| 59 |
if source_distribution == "uniform":
|