自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(16)
  • 资源 (1)
  • 收藏
  • 关注

原创 Tensorflow 图像识别分类

dataset.pyimport numpy as npimport osimport globfrom sklearn.utils import shuffleimport cv2def load_train(train_path,img_size,classes): images=[] labels=[] img_names=[] cls=[...

2018-09-07 21:31:19 2189 1

原创 tensorflow saver

# -*- coding: utf-8 -*-"""Created on Thu Sep 6 21:22:31 2018@author: lc"""import tensorflow as tfimport numpy as np#save#remember to define the same dtype and shape when restore#W=tf.Vari...

2018-09-06 21:53:58 157

原创 tensorflow 卷积神经网络

# -*- coding: utf-8 -*-"""Created on Thu Sep 6 16:12:22 2018@author: lc"""import tensorflow as tffrom tensorflow.examples.tutorials.mnist import input_data# number 1 to 10 datamnist=input_d...

2018-09-06 21:10:12 189

原创 Tensorflow drop_out

# -*- coding: utf-8 -*-"""Created on Thu Sep 6 14:44:08 2018@author: lc"""import tensorflow as tffrom sklearn.datasets import load_digitsfrom sklearn.model_selection import train_test_split...

2018-09-06 15:51:14 380

原创 TensorFlow 分类栗子

# -*- coding: utf-8 -*-"""Created on Wed Sep 5 19:53:23 2018@author: lc"""import tensorflow as tffrom tensorflow.examples.tutorials.mnist import input_data#如果没有这个数据集就下载,如果有就运行mnist=input_d...

2018-09-05 20:55:59 163

原创 Tensorboard 2

import tensorflow as tfimport matplotlib.pyplot as pltdef add_layer(inputs,in_size,out_size,n_layer,activation_function=None): layer_name='layer%s'%n_layer with tf.name_scope(layer_name): ...

2018-09-05 17:12:38 313

原创 Tensorboard

import tensorflow as tfimport numpy as npimport matplotlib.pyplot as pltdef add_layer(inputs,in_size,out_size,activation_function=None): with tf.name_scope('layer'): with tf.name_scope...

2018-09-04 21:39:09 165

原创 tensorflow 神经网络

import tensorflow as tfimport numpy as npimport matplotlib.pyplot as pltdef add_layer(inputs,in_size,out_size,activation_function=None): Weights=tf.Variable(tf.random_normal([in_size,out_size]...

2018-09-04 20:10:02 156

原创 tensorflow build a neural network

import tensorflow as tfimport numpy as npdef add_layer(inputs,in_size,out_size,activation_function=None): Weights=tf.Variable(tf.random_normal([in_size,out_size])) biases=tf.Variable(tf.zer...

2018-09-04 19:51:25 345

原创 tensorflow 激励函数

当神经网络层数较少时,各种通用激励函数都行 卷积神经网络:relu 循环神经网络:relu 或tanh

2018-09-04 19:50:32 385

原创 Tensorflow placeholder

import tensorflow as tfinput1=tf.placeholder(tf.float32)input2=tf.placeholder(tf.float32)output=tf.multiply(input1,input2)with tf.Session() as sess: print(sess.run(output,feed_dict={input1:[7...

2018-09-04 11:49:49 294

原创 Tensorflow 变量与常量

import tensorflow as tfstate=tf.Variable(0,name='counter')#print(state.name)one=tf.constant(1)new_value=tf.add(state,one)update=tf.assign(state,new_value)#must have if have vinit=tf.initialize...

2018-09-04 11:38:10 203

原创 TensorFlow session 的两种打开关闭方式

import tensorflow as tfmatrix1=tf.constant([[3,3]])matrix2=tf.constant([[2],[2]])product=tf.matmul(matrix1,matrix2)##method1#sess=tf.Session()#result=sess.run(product)#print(result)#sess.clos...

2018-09-03 21:41:48 10589

原创 tensorflow 小例子

import tensorflow as tfimport numpy as npx_data=np.random.rand(100).astype(np.float32)y_data =x_data*0.1+0.3#creat tensorflow startWeights=tf.Variable(tf.random_uniform([1],-1.0,1.0))biases=tf...

2018-09-03 21:28:03 278

原创 决策树、随机森林,小例子

import matplotlib.pyplot as pltimport pandas as pdfrom sklearn.datasets.california_housing import fetch_california_housinghousing=fetch_california_housing()print(housing.DESCR)from sklearn impor...

2018-08-27 22:04:06 791

原创 第一篇,不知写啥,就贴代码吧。朴素贝叶斯,垃圾邮件检测。

from spam.spamEmail import spamEmailBayesimport re#spam类对象spam=spamEmailBayes()#保存词频的词典spamDict={}normDict={}testDict={}#保存每封邮件中出现的词wordsList=[]wordsDict={}#保存预测结果,key为文件名,值为预测类别testResult...

2018-08-26 20:46:05 757

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除