我是pytorch的新手,我很难理解它是如何torch.nn.Parameter()工作的.
我已经浏览了https://pytorch.org/docs/stable/nn.html中的文档,但可能会对此有所了解.
有人可以帮忙吗?
我正在处理的代码片段:
def __init__(self, weight):
super(Net, self).__init__()
# initializes the weights of the convolutional layer to be the weights of the 4 defined filters
k_height, k_width = weight.shape[2:]
# assumes there are 4 grayscale filters
self.conv = nn.Conv2d(1, 4, kernel_size=(k_height, k_width), bias=False)
self.conv.weight = torch.nn.Parameter(weight)
Run Code Online (Sandbox Code Playgroud) 我正在学习机器人强化学习中采用的方法,并遇到了进化策略的概念。但我无法理解 RL 和 ES 有何不同。谁能解释一下?
robotics reinforcement-learning evolutionary-algorithm deep-learning