上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 16 下一页
摘要: 什么是激励函数(激活函数):在神经网络中原本输入输出都是线性关系,但现实中,许多的问题是非线性的(比如,房价问题中,房价不可能随着房子面积的增加一直线性增加),这个时候就神经网络的线性输出,再经过激励函数,便使得原本线性的关系变成非线性了,增强了神经网络的性能。 常用的激励函数(激活函数):relu 阅读全文
posted @ 2022-04-27 18:26 呦呦南山 阅读(123) 评论(0) 推荐(0) 编辑
摘要: def to_numpy(self) -> 'Batch': """Change all torch.Tensor to numpy.ndarray in-place.""" for k, v in self.items(): if isinstance(v, torch.Tensor): self 阅读全文
posted @ 2022-04-27 12:17 呦呦南山 阅读(173) 评论(0) 推荐(0) 编辑
摘要: PyTorch中的torch.nn.Parameter() 首先可以把这个函数理解为类型转换函数,将一个不可训练的类型Tensor转换成可以训练的类型parameter并将这个parameter绑定到这个module里面(net.parameter()中就有这个绑定的parameter,所以在参数优 阅读全文
posted @ 2022-04-27 11:26 呦呦南山 阅读(96) 评论(0) 推荐(0) 编辑
摘要: nn.ReLU(inplace=True) 参数inplace=True:inplace为True,将会改变输入的数据 ,否则不会改变原输入,只会产生新的输出inplace:can optionally do the operation in-place. Default: False注: 产生的计 阅读全文
posted @ 2022-04-27 11:18 呦呦南山 阅读(1306) 评论(0) 推荐(1) 编辑
摘要: def get_env_shape(task : str) -> Tuple[int, int]: env = get_env(task) obs_dim = env.observation_space.shape action_space = env.action_space if len(obs 阅读全文
posted @ 2022-04-25 21:49 呦呦南山 阅读(26) 评论(0) 推荐(0) 编辑
摘要: def sample_by_num(data_dict: dict, num: int): """ Sample num trajs from data_dict. """ samples = {} for k, v in data_dict.items(): if k == "index": sa 阅读全文
posted @ 2022-04-25 20:22 呦呦南山 阅读(19) 评论(0) 推荐(0) 编辑
摘要: # Prevent concurrent FileExistsErrortry: if not os.path.exists(to_path): os.mkdir(to_path)except Exception: passfrom offlinerl/neorl 阅读全文
posted @ 2022-04-25 18:59 呦呦南山 阅读(11) 评论(0) 推荐(0) 编辑
摘要: data_key = "-".join([task_name_version, data_type, str(least_num), train_or_val])output: 'HalfCheetah-v3-low-100-train'from: offlinerl/neorl 阅读全文
posted @ 2022-04-25 18:56 呦呦南山 阅读(9) 评论(0) 推荐(0) 编辑
摘要: def find_remote_file(data_json, task_name_version, data_type, traj_num, train_or_val): """ Find appropriate least dataset in remote (data_json) accord 阅读全文
posted @ 2022-04-25 18:46 呦呦南山 阅读(18) 评论(0) 推荐(0) 编辑
摘要: def get_file_md5(filename): if not os.path.isfile(filename): return my_hash = hashlib.md5() f = open(filename, 'rb') while True: b = f.read(8096) #set 阅读全文
posted @ 2022-04-25 18:43 呦呦南山 阅读(55) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 16 下一页