From c8bf617aca57ea9c53d4a76d23806cb5ab5173ab Mon Sep 17 00:00:00 2001 From: amstrongzyf <201840057@smail.nju.edu.cn> Date: Sat, 30 Aug 2025 00:45:55 +0800 Subject: [PATCH] fix: add missing self parameter to instance methods in DSProposalV2ExpGen (#1213) --- rdagent/scenarios/data_science/proposal/exp_gen/proposal.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rdagent/scenarios/data_science/proposal/exp_gen/proposal.py b/rdagent/scenarios/data_science/proposal/exp_gen/proposal.py index dbd13a71..0e3609d4 100644 --- a/rdagent/scenarios/data_science/proposal/exp_gen/proposal.py +++ b/rdagent/scenarios/data_science/proposal/exp_gen/proposal.py @@ -921,13 +921,13 @@ class DSProposalV2ExpGen(ExpGen): return index_to_pick_pool_list[reproducible_int] # BEGIN: for support llm-based hypothesis selection ----- - def _cosine_similarity_matrix_numpy(A, B): + def _cosine_similarity_matrix_numpy(self, A, B): dot_products = np.matmul(A, B.T) A_norms = np.linalg.norm(A, axis=1, keepdims=True) B_norms = np.linalg.norm(B, axis=1, keepdims=True).T return dot_products / (A_norms * B_norms) - def _gumbel_softmax_hard_sample(logits, tau=1.0, n_samples=1): + def _gumbel_softmax_hard_sample(self, logits, tau=1.0, n_samples=1): gumbel_noise = -np.log(-np.log(np.random.uniform(size=logits.shape) + 1e-20) + 1e-20) y = (logits + gumbel_noise) / tau