AlphaFold3 data_modules 模块的 OpenFoldMultimerDataset
类的静态方法 get_stochastic_train_filter_prob
的目的是为多链蛋白(multimer)数据中每条链计算一个随机采样概率列表,这些概率用于后续在训练中对不同链的采样进行加权。
源代码:
@staticmethoddef get_stochastic_train_filter_prob(cache_entry: Any,*args, **kwargs) -> list:# Stochastic filterscluster_sizes = cache_entry.get("cluster_sizes")if cluster_sizes is not None:return [1 / c if c > 0 else 1 for c in cluster_sizes]num_chains = len(cache_entry["chain_ids"])return [1.] * num_chains
代码解读:
1. 检查 cluster_sizes
cluster_sizes = cache_entry.get("cluster_sizes")
if cluster_sizes is not None:return [1 / c if c > 0 else 1 for c in cluster_sizes]
-
逻辑说明</