|
|
|
|
|
02 2019 档案
吴裕雄 python深度学习与实践(12)
摘要:import tensorflow as tf q = tf.FIFOQueue(1000,"float32") counter = tf.Variable(0.0) add_op = tf.assign_add(counter, tf.constant(1.0)) enqueueData_op = q.enqueue(counter) sess = tf.Session() qr = tf...
阅读全文
吴裕雄 python深度学习与实践(11)
摘要:import numpy as np from matplotlib import pyplot as plt A = np.array([[5],[4]]) C = np.array([[4],[6]]) B = A.T.dot(C) AA = np.linalg.inv(A.T.dot(A)) l=AA.dot(B) P=A.dot(l) x=np.linspace(-2,2,10) ...
阅读全文
吴裕雄 python深度学习与实践(10)
摘要:import tensorflow as tf input1 = tf.constant(1) print(input1) input2 = tf.Variable(2,tf.int32) print(input2) input2 = input1 sess = tf.Session() print(sess.run(input2)) import tensorflow as tf...
阅读全文
吴裕雄 python深度学习与实践(9)
摘要:import numpy as np import tensorflow as tf inputX = np.random.rand(100) inputY = np.multiply(3,inputX) + 1 x = tf.placeholder("float32") y_ = tf.placeholder("float32") weight = tf.Variable(0.25) ...
阅读全文
吴裕雄 python深度学习与实践(8)
摘要:import cv2 import numpy as np img = cv2.imread("G:\\MyLearning\\TensorFlow_deep_learn\\data\\lena.jpg") img_hsv = cv2.cvtColor(img,cv2.COLOR_BGR2HSV) turn_green_hsv = img_hsv.copy() turn_green_hsv[:...
阅读全文
吴裕雄 python深度学习与实践(7)
摘要:import cv2 import numpy as np img = np.mat(np.zeros((300,300))) cv2.imshow("test",img) cv2.waitKey(0) import cv2 import numpy as np img = np.mat(np.zeros((300,300),dtype=np.uint8)) cv2.imshow("te...
阅读全文
吴裕雄 python深度学习与实践(6)
摘要:from pylab import * import pandas as pd import matplotlib.pyplot as plot import numpy as np filePath = ("G:\\MyLearning\\TensorFlow_deep_learn\\data\\dataTest.csv") dataFile = pd.read_csv(filePath,h...
阅读全文
吴裕雄 python深度学习与实践(5)
摘要:import numpy as np data = np.mat([[1,200,105,3,False], [2,165,80,2,False], [3,184.5,120,2,False], [4,116,70.8,1,False], [5,270,150,4,True]...
阅读全文
吴裕雄 python深度学习与实践(4)
摘要:import numpy,math def softmax(inMatrix): m,n = numpy.shape(inMatrix) outMatrix = numpy.mat(numpy.zeros((m,n))) soft_sum = 0 for idx in range(0,n): outMatrix[0,idx] = math.exp...
阅读全文
吴裕雄 python深度学习与实践(3)
摘要:import threading, time def doWaiting(): print('start waiting:', time.strftime('%S')) time.sleep(3) print('stop waiting', time.strftime('%S')) thread1 = threading.Thread(target = doWaitin...
阅读全文
吴裕雄 python深度学习与实践(2)
摘要:#coding = utf8 import threading,time,random count = 0 class MyThread (threading.Thread): def __init__(self,lock,threadName): super(MyThread,self).__init__(name = threadName) sel...
阅读全文
吴裕雄 python深度学习与实践(1)
摘要:#coding = utf8 import threading,time count = 0 class MyThread(threading.Thread): def __init__(self,threadName): super(MyThread,self).__init__(name = threadName) def run(self): ...
阅读全文
|
|