AlienChen's picture
download
raw
1.2 kB
import pandas as pd
import torch
import pdb
samples = '/scratch/pranamlab/tong/pCoMol/peptidomimetics/samples/hyperparameter_ablation/2QSC_rollout_30.csv'
df = pd.read_csv(samples)
toxicities = df['Toxicity'].tolist()
solubilities = df['Solubility'].tolist()
permeabilities = df['Permeability'].tolist()
halflifes = df['Halflife'].tolist()
affinities = df['Affinity'].tolist()
motifs = df['Motif'].tolist()
specificities = df['Specificity'].tolist()
def _augmented_tchebycheff(
f_vals: torch.Tensor,
w: torch.Tensor,
) -> torch.Tensor:
diff = f_vals
term1 = torch.min(w * diff)
term2 = 0.5 * torch.sum(w * diff)
return term1 + term2
weight = torch.tensor([4, 2, 4, 0.2, 4, 2, 1])
original_scores = torch.tensor([0.4621,0.7744,0.2787,2.5357,0.5218,0.3083,0.9954])
print(f"Original Utility: ", _augmented_tchebycheff(original_scores, weight))
# utilities = []
# for i in range(len(df)):
# f_vals = torch.tensor([toxicities[i], solubilities[i], permeabilities[i], halflifes[i], affinities[i], motifs[i], specificities[i]])
# utility = _augmented_tchebycheff(f_vals, weight)
# utilities.append(utility)
# print("Average Utility: ", sum(utilities) / len(utilities))

Xet Storage Details

Size:
1.2 kB
·
Xet hash:
f817636cca09273057ac4cd9c9f8aa4e8464d4523cd0a2d0b5c0623d7f2c06ab

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.