the random noise and the gaussian noise

            if use_noise == "random noise":

                noise = (

                    torch.randn_like(torch.Tensor(action)) * policy_noise

                ).clamp(-noise_clip, noise_clip).numpy()

                action = (action + noise).clip(-max_action, max_action)

            if use_noise == "gaussian noise":

                noise_size = (torch.Tensor(action).size()[0],)

                import pdb

                pdb.set_trace()

                noise = (

                    torch.normal(mean=0.,std=policy_noise,size=noise_size)

                ).clamp(-noise_clip, noise_clip).numpy()

posted @ 2022-10-10 21:16  呦呦南山  阅读(35)  评论(0编辑  收藏  举报