AlphaFold3 data_modules 模块的 OpenFoldDataset
类的 get_stochastic_train_filter_prob
方法是类的静态方法(@staticmethod
),该方法接收一个 cache_entry
(字典或类似的结构),用于存储蛋白质的相关信息。返回一个 浮点数,表示当前样本的采样概率。
源代码:
@staticmethod
def get_stochastic_train_filter_prob(
cache_entry: Any,
*args, **kwargs
) -> float:
# Stochastic filters
probabilities = []
cluster_size = cache_entry.get("cluster_size", None)
if cluster_size is not None and cluster_size > 0:
probabilities.append(1 / cluster_size)
chain_length = len(cache_entry["seq"])
probabilities.append((1 / 512) * (max(min(chain_length, 512), 256)))
# Risk of underflow here?
out = 1
for p in probabilities: