如何在tf_agents中编写自定义策略

发布于 2025-01-26 04:19:03 字数 301 浏览 6 评论 0原文

我想在TF_AGENTS中使用上下文强盗代理(线性刺激采样剂)。

我正在使用自定义环境,奖励延迟​​了3天。因此,用于训练,观察结果是从保存的历史表(3天前产生的预测)及其相应的奖励(也在表中)产生的。

鉴于此,只有在培训期间,我如何制定从历史表中输出一个给定观察的行动的政策?在评估期间,我希望该政策以通常的方式行事,并使用从中学到的政策产生行动。

看来我需要编写一种自定义策略,在训练过程中以某种方式行事,并且在评估过程中表现为通常的自我(线性刺激)。不幸的是,我找不到本用户酶的任何示例或文档。有人可以解释一下如何编码吗?一个例子将非常有用

I wanted to use the contextual bandit agents (LinearThompson Sampling agent) in the tf_Agents.

I am using a custom environment and my rewards are delayed by 3 days. Hence for training, the observations are generated from the saved historical tables (predictions generated 3 days ago) and their corresponding rewards (Also in the table).

Given this, only during training, how do I make the policy to output an action, for a given observation, from the historical tables? And during evaluation I want the policy to behave the usual way, generating the actions using the policy it learned from.

Looks like I need to write a custom policy, that behaves in a way during training and behaves it's usual self (linearthompsonsampling.policy) during evaluation. Unfortunately I couldn't find any examples or documentation for this usecase. Can someone please explain how to code this - an example would be very useful

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文