- 博客(13)
- 资源 (3)
- 收藏
- 关注
原创 ERROR: Could not find a version that satisfies the requirement sklearn
@TOCERROR: Could not find a version that satisfies the requirement sklearn网速问题,使用镜像可以解决pip install sklearn -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
2021-09-14 14:38:06 1344 1
原创 全连接神经网络mnist数据集训练
两个隐藏层,每个隐藏层256个神经元,784行输入,1个输出。It is interesting the first time I train the model with the learning rate 0.01, the accuracy is 0.9721 !!!Amazing !!!However, with the same paremeters, the second is 0.8251. This phenomenon indicates that the result is var
2020-12-04 14:59:34 339
原创 神经网络隐藏层 解决 非线性问题
实例中通过单个隐藏层神经网络来拟合抑或运算,隐藏层使用Relu函数进行激活,输出层使用Tanh函数进行激活。# -*- coding: utf-8 -*-"""Created on Fri Dec 4 09:46:52 2020@author: Melinda"""import tensorflow as tfimport numpy as np# ------定义变量-----------learning_rate =1e-4n_input = 2n_label = 1n_h
2020-12-04 11:12:38 468
原创 Mnist手写数字识别代码
# -*- coding: utf-8 -*-"""Created on Wed Dec 2 11:49:26 2020@author: Melinda"""'''train的shape (55000, 784)test的shape: (10000, 784)validation的shape: (5000, 784)''''''im = mnist.train.images[1] #[55000,784]im = im.reshape(-1, 28)pylab.imshow
2020-12-02 15:51:08 397
原创 Spyder建模 y = 2*x
# -*- coding: utf-8 -*-"# 创建函数图像import tensorflow as tfimport numpy as npimport matplotlib.pyplot as plttrain_X = np.linspace(-1, 1, 100)train_Y = 2 * train_X + np.random.randn(*train_X.shape) * 0.3plt.plot(train_X, train_Y, 'ro', label='Original
2020-11-16 21:50:11 260
原创 Tensorflow虚拟环境相关操作
创建虚拟环境conda create -n tensorflow_cpu python=3.7删除虚拟环境conda remove --name your_env_name --all查看当前虚拟环境conda info --envs
2020-10-12 19:01:10 274
原创 神经网络的学习步骤
前提神经网络存在合适的权重和偏置,调整权重和偏置以便拟合训练数据的过程成为“学习”。神经网络的学习分成下面4个步骤。步骤1(mini-batch)从训练数据中随机选出一部分数据,这部分数据称为mini-batch。我们的目标是减少mini-batch的损失函数的值。步骤2(计算梯度)为了减少mini-batch损失函数的值,需要求出各个权重参数的梯度。梯度表示损失函数值减少最多的方向。步骤3(更新参数)将权重参数沿梯度方向进行微小更新。步骤4(重复)重复步骤1,2,3.这个方法通过梯度下
2020-09-14 09:54:06 2106
原创 Python求解二元二次函数梯度
import numpy as npimport matplotlib.pylab as pltfrom mpl_toolkits.mplot3d import Axes3D#数值微分求解梯度def _numerical_gradient_no_batch(f, x): h = 1e-4 # 0.0001 grad = np.zeros_like(x) for idx in range(x.size): tmp_val = x[idx] .
2020-09-13 12:17:23 1816
原创 Tensorflow2.0实战——Softmax
Softmax多分类Softmax在Tensorflow 2.0 中有两个可以调用的分类方法,一个是sparse_categorical_crossentropy,一个是categorical_crossentropy。前者基于顺序编码,后者是onehot编码。下面将通过一个例子进行介绍。和上篇博客相同的部分,将不做介绍,链接地址:Tensorflow2.0实战——逻辑回归本实例中使用的数据集是fashion_mnist数据集,提取码:gkjbimport tensorflow as tfimp
2020-06-30 20:17:01 904
原创 Tensorflow2.0实战——逻辑回归
Tensorflow2.0界面更加简洁,对使用者也更加友好,下面笔者以逻辑回归为例来分享一下Tensorflow2.0的使用。导入库import tensorflow as tfimport pandas as pdimport matplotlib.pyplot as plt%matplotlib inline读入数据data = pd.read_csv('creditcard.csv')这里笔者的数据是放在同级目录下的,如果目录不一致,需要自行修改。笔者的数据集是信用数据集
2020-06-29 20:09:07 1079
原创 apache-maven-3.3.3 安装包
链接:https://pan.baidu.com/s/1exOuC_V1-_qFzRrAOsAQLg提取码:ikns
2020-05-07 21:28:49 728
原创 github代码上传
准备工作注册一个github账号,网址:github官网注册,注册之后需要牢记账号和密码,后续push时需要安装git工具,下载地址:git工具地址具体操作进入github页面,点击New repository填写仓库相关信息注意到:gtignore:不需要进行版本的仓库类型,会生成.gitignore文件license:证书类型,对应生成LICENSE记下生成的web UR...
2020-04-28 09:19:55 270
原创 小白学习之Tensorflow安装
Tensorflow安装以及填坑Tensorflow安装过程中会出现各种问题,经过无数次跳坑之后,终于解决问题,所以就记录一下:(1)环境:Win10(2)安装步骤:a.安装VC2015(这是基础)b.安装Anaconda安装地址:https://www.anaconda.com/选择合适自己的版本就很好啦注:安装过程中默认的两个选项都选上,path路径会自动添加,还会下载相应的...
2020-03-16 16:34:23 196
fashion-mnist.zip
2020-06-30
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人