python
zyj20200
这个作者很懒,什么都没留下…
展开
-
lambda、map、filter、reduce
1、三元表达式简单的 if else 语句,可以使用三元运算来表示# 普通条件语句if 1 == 1: name = '张三'else: name = '李四' # 三元运算name = '张三' if 1 == 1 else '李四'2、lambda表达式# 定义函数(普通方式)def func(arg): return arg + 1...转载 2018-07-17 14:44:47 · 368 阅读 · 0 评论 -
pytorch learn 05 多层神经网络,Sequential 和 Module
From: https://github.com/L1aoXingyu/code-of-learn-deep-learning-with-pytorch在前面的线性回归中,我们的公式是 y=wx+by = w x + by=wx+b,而在 Logistic 回归中,我们的公式是 y=Sigmoid(wx+b)y = Sigmoid(w x + b)y=Sigmoid(wx+b),其实它们都可...原创 2019-07-23 11:13:07 · 459 阅读 · 0 评论 -
pytorch learn 04 Logistic Regression
From: https://github.com/L1aoXingyu/code-of-learn-deep-learning-with-pytorchLogistic 回归是一种广义的回归模型,其与多元线性回归有着很多相似之处,模型的形式基本相同,虽然也被称为回归,但是其更多的情况使用在分类问题上,同时又以二分类更为常用。Logistic 回归的模型形式和线性回归一样,都是 y = wx...原创 2019-07-23 10:55:47 · 162 阅读 · 0 评论 -
pytorch learn 03 Linear Regression
From: https://github.com/L1aoXingyu/code-of-learn-deep-learning-with-pytorch线性回归是监督学习里面一个非常简单的模型,同时梯度下降也是深度学习中应用最广的优化算法,我们将从这里开始我们的深度学习之旅生成数据x_train = np.array([[3.3], [4.4], [5.5], [6.71], [6.93...原创 2019-07-23 10:39:37 · 119 阅读 · 0 评论 -
pytorch learn 02 autograd
From: https://github.com/L1aoXingyu/code-of-learn-deep-learning-with-pytorch自动求导是 PyTorch 中非常重要的特性,能够让我们避免手动去计算非常复杂的导数,这能够极大地减少了我们构建模型的时间,这也是其前身 Torch 这个框架所不具备的特性,下面我们通过例子看看 PyTorch 自动求导的独特魅力以及探究自动...原创 2019-07-23 10:24:08 · 112 阅读 · 0 评论 -
pytorch learn 01 base
From: https://github.com/L1aoXingyu/code-of-learn-deep-learning-with-pytorchPyTorch 的官方介绍是一个拥有强力GPU加速的张量和动态构建网络的库,其主要构件是张量,所以我们可以把 PyTorch 当做 NumPy 来用,PyTorch 的很多操作好 NumPy 都是类似的,但是因为其能够在 GPU 上运行,所以...原创 2019-07-23 10:12:46 · 123 阅读 · 0 评论 -
pytorch learn 07 优化算法
From: https://github.com/L1aoXingyu/code-of-learn-deep-learning-with-pytorch1 SGD数据def data_df(x): x = np.array(x, dtype='float32') / 255 x = (x -0.5) / 0.5 x = x.reshape((-1, )) # 拉平...原创 2019-07-23 16:26:46 · 270 阅读 · 1 评论 -
python pip3 install 模块缓慢解决方案
SegmentFault:https://segmentfault.com/q/1010000000162410pip install -i https://pypi.doubanio.com/simple/ 包名或者pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple 包名例如:pip3 install -i h...转载 2018-03-04 14:14:24 · 2653 阅读 · 1 评论 -
python模块打包及离线安装
1 将当前环境所需的python模块打包1.pip freeze > requestments.txt2.pip download -r requirements.txt -d /home/zyj/bags2 在服务器上离线安装打包的模块2.1 服务器python安装pip(若已经安装了pip,则跳过,直接到第下一步)2.1.1 安装setuptools1.解压setup...原创 2019-01-24 08:45:37 · 2860 阅读 · 0 评论 -
centos6.8使用pyinstaller异常解决记录
执行:pyinstaller -F test.py提示:Traceback (most recent call last): File "/usr/local/bin/pyinstaller", line 9, in <module> load_entry_point('PyInstaller==3.4', 'console_scripts', 'pyins...原创 2018-11-14 10:15:20 · 782 阅读 · 0 评论 -
matplotlib学习记录
import matplotlib.pyplot as pltplt.plot([1,2,3,4])plt.ylabel('some numbers')plt.show()import matplotlib.pyplot as pltplt.plot([1,2,3,4], [1,4,9,16], 'ro')plt.axis([0, 6, 0, 20])plt.show(...原创 2018-08-14 22:16:34 · 197 阅读 · 0 评论 -
激活pycharm
1、将“0.0.0.0 account.jetbrains.com”中的内容添加到hosts文件中,hosts路径为:C:\Windows\System32\drivers\etc2、打开http://idea.lanyus.com/ ,点击激活,获得并复制注册码。3、打开pycharm,选择 第二个选项:Activate code(用激活码激活),把第二步复制的注册码粘贴在下面的文本...转载 2018-07-20 14:15:57 · 1842 阅读 · 0 评论 -
pytorch learn 06 深层神经网络&参数初始化
From: https://github.com/L1aoXingyu/code-of-learn-deep-learning-with-pytorchmnist 数据集是一个非常出名的数据集,基本上很多网络都将其作为一个测试的标准,其来自美国国家标准与技术研究所, National Institute of Standards and Technology (NIST)。 训练集 (tra...原创 2019-07-23 11:32:58 · 594 阅读 · 1 评论