高级主动学习策略与主动迁移学习方法详解
1. 结合不确定性采样和多样性采样
在代码示例中,我们计算了簇中所有项目的平均熵,代码如下:
score = method(prob_dist.data[0]) # get the specific type of
# ➥ uncertainty sampling
total_uncertainty += score
count += 1
average_uncertainty = total_uncertainty / count
if average_uncertainty > highest_average_uncertainty:
highest_average_uncertainty = average_uncertainty
most_uncertain_cluster = cluster
samples = most_uncertain_cluster.get_random_members(number)
return samples
你可以根据采样策略尝试不同的聚合统计。例如,如果你只对前 100 个项目进行采样,可以计算每个簇中最不确定的 100 个项目的平均熵,而不是整个簇中每个项目的平均熵。你可以使用以下命令尝试此技术:
python active_learning.py --high_uncertainty_cluster=100 --verbose
超级会员免费看
订阅专栏 解锁全文
1508

被折叠的 条评论
为什么被折叠?



