Skip to content

Commit d8c7ced

Browse files
committed
Some more multimutant runs.
1 parent 2032b8b commit d8c7ced

7 files changed

Lines changed: 1488388 additions & 5 deletions

backend/src/folde/data.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,11 @@ def get_proteingym_dataset(
173173
incomplete_naturalness_df["seq_id"] = incomplete_naturalness_df["seq_id"].apply(
174174
lambda x: maybe_modify_seq_id(dms_id, x)
175175
)
176-
if any(incomplete_naturalness_df["wt_marginal"] <= 0):
177-
raise ValueError("wt_marginal is negative or zero")
176+
if any(incomplete_naturalness_df["wt_marginal"] < 0):
177+
raise ValueError(f"wt_marginal for {dms_id} is negative, eg: {incomplete_naturalness_df[incomplete_naturalness_df['wt_marginal'] <= 0]['wt_marginal'].tolist()[:5]}")
178+
179+
def safe_log_for_wt_naturalness(x):
180+
return np.log(max(x, 1e-20))
178181
if (
179182
"model" in incomplete_naturalness_df.columns
180183
and incomplete_naturalness_df.model.unique().size > 1
@@ -184,8 +187,8 @@ def get_proteingym_dataset(
184187
# Note that we deliberately lose the wt_marginal column - we want this to crash
185188
# later on, unless the user specifies the proper column names.
186189
incomplete_naturalness_df["log_wt_marginal"] = incomplete_naturalness_df[
187-
"wt_marginal"
188-
].apply(np.log)
190+
"wt_marginal"
191+
].apply(safe_log_for_wt_naturalness)
189192
incomplete_naturalness_df["model"] = incomplete_naturalness_df["model"].apply(
190193
lambda x: f"log_wt_marginal_{x}"
191194
)
@@ -195,7 +198,7 @@ def get_proteingym_dataset(
195198
else:
196199
# Otherwise, under normal circumstances, just set up seq_id as index.
197200
incomplete_naturalness_df = incomplete_naturalness_df.set_index("seq_id", drop=False)
198-
incomplete_naturalness_df['log_wt_marginal'] = incomplete_naturalness_df['wt_marginal'].apply(np.log)
201+
incomplete_naturalness_df['log_wt_marginal'] = incomplete_naturalness_df['wt_marginal'].apply(safe_log_for_wt_naturalness)
199202
incomplete_naturalness_df.drop(columns=['wt_marginal'], inplace=True)
200203

201204
seq_ids_with_naturalness = set(incomplete_naturalness_df.index)

backend/src/notebooks/jacob/250905_multimutant_benchmark.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,30 @@
177177
"zero_shot_model_params.lie_noise_stddev_multiplier": 4.0,
178178
"few_shot_model_params.decision_mode": "mean",
179179
}),
180+
ModelDiff(name="with-esmv1-nocl-nowarmstart", diffs={
181+
"naturalness_model_id": "1v",
182+
"naturalness_columns": [
183+
"log_wt_marginal_1",
184+
"log_wt_marginal_2",
185+
"log_wt_marginal_3",
186+
"log_wt_marginal_4",
187+
"log_wt_marginal_5",
188+
],
189+
"few_shot_model_params.decision_mode": "mean",
190+
}),
191+
ModelDiff(name="with-esmv1-zsclS4-r1only-nowarmstart", diffs={
192+
"naturalness_model_id": "1v",
193+
"naturalness_columns": [
194+
"log_wt_marginal_1",
195+
"log_wt_marginal_2",
196+
"log_wt_marginal_3",
197+
"log_wt_marginal_4",
198+
"log_wt_marginal_5",
199+
],
200+
"zero_shot_model_params.decision_mode": "constantliar",
201+
"zero_shot_model_params.lie_noise_stddev_multiplier": 4.0,
202+
"few_shot_model_params.decision_mode": "mean",
203+
}),
180204
],
181205
)
182206
)

backend/src/notebooks/jacob/250905_test_benchmark.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,30 @@
191191
"zero_shot_model_params.lie_noise_stddev_multiplier": 4.0,
192192
"few_shot_model_params.decision_mode": "mean",
193193
}),
194+
ModelDiff(name="with-esmv1-nocl-nowarmstart", diffs={
195+
"naturalness_model_id": "1v",
196+
"naturalness_columns": [
197+
"log_wt_marginal_1",
198+
"log_wt_marginal_2",
199+
"log_wt_marginal_3",
200+
"log_wt_marginal_4",
201+
"log_wt_marginal_5",
202+
],
203+
"few_shot_model_params.decision_mode": "mean",
204+
}),
205+
ModelDiff(name="with-esmv1-zsclS4-r1only-nowarmstart", diffs={
206+
"naturalness_model_id": "1v",
207+
"naturalness_columns": [
208+
"log_wt_marginal_1",
209+
"log_wt_marginal_2",
210+
"log_wt_marginal_3",
211+
"log_wt_marginal_4",
212+
"log_wt_marginal_5",
213+
],
214+
"zero_shot_model_params.decision_mode": "constantliar",
215+
"zero_shot_model_params.lie_noise_stddev_multiplier": 4.0,
216+
"few_shot_model_params.decision_mode": "mean",
217+
}),
194218
],
195219
)
196220
)

0 commit comments

Comments
 (0)