
机器学习
锅锅是锅锅
这个作者很懒,什么都没留下…
展开
-
卷积神经网络相关函数的实现--c语言
一、介绍这里主要介绍卷积相关函数用c语言实现,如卷积、池化、全零填充等等二、单核单通道卷积//单卷积 #define IMG_SIZE 5#define W_SIZE 3#define OUT_SIZE 3int conv(float img[IMG_SIZE][IMG_SIZE], float w[W_SIZE][W_SIZE], float out[OUT_SIZE][OUT_SIZE]){ int i,j,k,r,m,n; float tmp; //单张图片卷积 for(原创 2021-05-09 12:54:34 · 1788 阅读 · 0 评论 -
全连接神经网络手写体推理实现--c语言
一、介绍输入28x28的图片像素点范围0-1浮点数输出0-9的概率二、代码实现核心代码int my_predict(float *x, float *w1, float *b1, float *w2, float *b2){ float l1[64] = {0},l2[10] = {0},tmp = 0; int i,j,k; //第一层64个神经元 x 28x28 w 784*64个 b 64个 输出 64个输出 //w1x1+w2x2 ... wnxn+b printf(原创 2021-05-09 12:44:33 · 1044 阅读 · 0 评论 -
卷积神经网络手写体推理代码实现--基于python tensorflow
一、介绍输入为28x28的图片的浮点型数据输出0-9的概率值二、代码#导入库import tensorflow as tffrom tensorflow.examples.tutorials.mnist import input_data#产生权重参数变量def w_value(shape): w_v = tf.truncated_normal(shape, stddev=0.1)#生成张量产生随机数填充 return tf.Variable(w_v)#返回变量张量,填充随原创 2021-05-09 12:18:39 · 243 阅读 · 0 评论 -
卷积神经网络手写体训练代码实现--基于python tensorflow
一、介绍输入为28x28的图片的浮点型数据输出0-9的概率值二、代码#导入库import tensorflow as tffrom tensorflow.examples.tutorials.mnist import input_data#产生权重参数变量def w_value(shape): w_v = tf.truncated_normal(shape, stddev=0.1)#生成张量产生随机数填充 return tf.Variable(w_v)#返回变量张量,填充随原创 2021-05-09 12:17:17 · 166 阅读 · 0 评论 -
全连接神经网络手写体推理代码实现--基于python tensorflow
一、介绍输入为28x28的图片的浮点型数据输出0-9的概率值二、代码#导入tensorflow库import tensorflow as tffrom tensorflow.examples.tutorials.mnist import input_dataimport numpy as np#下载数据集mnist = input_data.read_data_sets('MNIST_data/', one_hot=True)#输入x = tf.placeholder(tf.f原创 2021-05-09 12:12:41 · 205 阅读 · 0 评论 -
全连接神经网络手写体训练代码实现--基于python tensorflow
#导入tensorflow库import tensorflow as tffrom tensorflow.examples.tutorials.mnist import input_dataimport numpy as np#下载数据集mnist = input_data.read_data_sets('MNIST_data/', one_hot=True)#输入x = tf.placeholder(tf.float32, [None, 784])#目标输出y = tf.pla原创 2021-05-09 12:08:21 · 153 阅读 · 0 评论 -
python——tensorflow使用和两层全连接神经网络搭建
一、Tensorflow使用1、Tensorflow简介TensorFlow是一个软件库,封装了建构神经网络的API,类似于MatLab的神经网络工具箱,是Google于2015年推出的深度学习框架(目前最流行的深度学习框架)计算图①计算图(Graph),如上图,表述了一个计算任务(也可以说是训练任务)。②张量(Tensor),是对矢量和矩阵向潜在的更高维度的泛化。TensorFlow在内部将张量表示为基本数据类型的 n 维数组。例:线性代数中用秩来表示矩阵的维度,同样在TensorFlow中也原创 2021-01-03 19:34:42 · 1908 阅读 · 0 评论 -
二、python+tensorflow windows环境搭建
一、下载安装python3.7.9二、下载安装tensorflowpip install tensorflow1.15 jupyter三、安装相关库pip install opencv-python pillow scipy1.2.1四、安装virtualenv虚拟的python环境pip3 install virtualenv测试五、使用设置虚拟环境位置cd C:\Users\AWcloud\Desktop\python_env搭建虚拟环境virtualenv py_test原创 2020-12-16 17:46:08 · 276 阅读 · 0 评论