From 0be3e4877da9b8315c8fea5a09742e50b0b1a9a7 Mon Sep 17 00:00:00 2001 From: Hongsheng Zeng Date: Mon, 23 Mar 2020 16:39:51 +0800 Subject: [PATCH] Update README.md --- deepes/README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/deepes/README.md b/deepes/README.md index 81b9c5d..179a396 100644 --- a/deepes/README.md +++ b/deepes/README.md @@ -10,8 +10,10 @@ DeepES是一个支持**快速验证**ES效果、**兼容多个框架**的C++库 auto agent = ESAgent(config); for (int i = 0; i < 100; ++i) { - int key = agent->add_noise(); // 参数扰动,同时保存随机种子 - int reward = evaluate(env, agent); //评估参数 + auto sampling_agnet = agent->clone(); // clone出一个sampling agent + SamplingKey key; + agent->add_noise(key); // 参数扰动,同时保存随机种子到key中 + int reward = evaluate(env, sampling_agent); //评估参数 noisy_keys.push_back(key); // 记录随机噪声对应种子 noisy_rewards.push_back(reward); // 记录评估结果 } -- GitLab