随笔分类 -  Python

摘要:直接在GitHub上下载:https://github.com/nltk/nltk_data 之后将其中的packages文件夹中的文件,放在nltk_data目录下就行 阅读全文
posted @ 2022-06-16 22:56 维和战艇机 阅读(451) 评论(0) 推荐(0)
摘要:单臂摆是强化学习的一个经典模型,本文采用了4种不同的算法来解决这个问题,使用Pytorch实现。 以下是老版本,2022年9月14日新增Dueling DQN, Actor-Critic算法, SAC,更新了PPO,DDPG算法,在文末。 DQN: 参考: 算法思想: https://mofanpy 阅读全文
posted @ 2021-03-27 10:49 维和战艇机 阅读(8918) 评论(1) 推荐(2)
摘要:参考莫烦python: cnn: import torch import torch.utils.data as Data import matplotlib.pyplot as plt import torch.nn.functional as F import torch.nn as nn im 阅读全文
posted @ 2021-03-12 00:17 维和战艇机 阅读(144) 评论(0) 推荐(0)
摘要:1、使用梯度下降法拟合y = sin(x) import numpy as np import torch import torchvision import torch.optim as optim import torch.nn as nn import torch.nn.functional 阅读全文
posted @ 2021-01-29 21:56 维和战艇机 阅读(170) 评论(0) 推荐(0)
摘要:自动求导: https://zhuanlan.zhihu.com/p/84812085 Pytorch入门教程: https://github.com/fendouai/PyTorchDocs/blob/master/SecondSection/training_a_classifier.md Py 阅读全文
posted @ 2021-01-26 18:36 维和战艇机 阅读(113) 评论(0) 推荐(0)
摘要:参考链接:https://blog.csdn.net/u013733326/article/details/80086090 大致了解卷积神经网络的实现细节,具体实现的时候直接调用相关库函数就行 # coding=utf-8 # This is a sample Python script. # P 阅读全文
posted @ 2021-01-22 17:08 维和战艇机 阅读(247) 评论(0) 推荐(0)
摘要:参考链接:https://blog.csdn.net/u013733326/article/details/79907419 代码: # coding=utf-8 # This is a sample Python script. # Press ⌃R to execute it or replac 阅读全文
posted @ 2021-01-20 16:39 维和战艇机 阅读(216) 评论(0) 推荐(0)
摘要:参考链接:https://blog.csdn.net/u013733326/article/details/79847918 与原博文不同,我直接改动了第一课第四周的作业代码,只测试了L2正则化和随机初始化的效果。L2正则化可以明显的缓解过度拟合的情况 代码: # coding=utf-8 # Th 阅读全文
posted @ 2021-01-19 20:46 维和战艇机 阅读(233) 评论(0) 推荐(0)
摘要:参考链接:https://blog.csdn.net/u013733326/article/details/79767169 搭建多层神经网络步骤: 1、初始化 2、前向传播 (1)线性部分 (2)激活部分 3、计算代价(判断有没有学习) 4、反向传播 (1)线性部分 (2)激活部分 5、更新参数 阅读全文
posted @ 2021-01-19 11:28 维和战艇机 阅读(314) 评论(0) 推荐(0)
摘要:参考链接:https://blog.csdn.net/u013733326/article/details/79702148 # coding=utf-8 # This is a sample Python script. # Press ⌃R to execute it or replace it 阅读全文
posted @ 2021-01-18 15:07 维和战艇机 阅读(204) 评论(0) 推荐(0)
摘要:1、numpy库 import numpy as np np.random.seed(1) #设置随机种子 np.log(x) #给list中的每个元素取对数 np.multiply(x, y) #list中对应元素相乘 np.dot(x, y) #矩阵乘法 np.power(x, 2) #list 阅读全文
posted @ 2021-01-18 15:04 维和战艇机 阅读(185) 评论(0) 推荐(0)
摘要:参考大佬的博客https://blog.csdn.net/u013733326/article/details/79639509 代码: # coding=utf-8 # This is a sample Python script. # Press ⌃R to execute it or repl 阅读全文
posted @ 2021-01-17 17:09 维和战艇机 阅读(215) 评论(0) 推荐(0)