原创 使用Tensorboard增加變量顯示

通過Tensorboard查看模型的參數、損失值等量值的變化。 import tensorflow as tf import numpy as np def linear_regression(): # 1、準備數據

原创 實現簡單的貼吧爬蟲——獲取html

# coding = "utf-8" import requests class tiebaSpider: def __init__(self, tieba_name): self.name = tieba_name

原创 tensorflow中placeholder、feed_dict以及變量命名空間variable_scope的使用

import tensorflow as tf def demo(): a = tf.compat.v1.placeholder(tf.float32) b = tf.compat.v1.placeholde

原创 使用TF-IDF模型對文本進行特徵提取、結構化表示及文本相似度度量

https://www.jianshu.com/p/1badbe05b6d9 詞袋模型和詞向量模型 https://www.cnblogs.com/chenyusheng0803/p/10978883.html

原创 Tensorflow2.0-數據流圖

import tensorflow as tf def tensorflow_demo(): # tensorflow中的圖有兩種: # 1、默認圖 # 2、用戶自定義的圖(tf.Graph())

原创 tensorflow數據讀取之文件讀取流程

這裏的string_tensor直接寫入“文件名、路徑”所構成的列表即可,tensorflow自動將其轉換爲一階張量;shuffle=True作用爲打亂傳入的文件名的順序。 # 1、構造一個文件名隊列 file_queue =

原创 tensorflow的圖片操作之圖片數據的讀取

import tensorflow as tf import os import numpy as np def picture_read(file_list): # 1、創建文件名隊列,file_list爲路徑加文件名

原创 tensorflow二進制圖片數據的讀取

import tensorflow as tf import os import numpy as np class Cifar(object): def __init__(self): # 初始化一個

原创 用卷積神經網絡進行mnist手寫體識別

import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data import numpy as np def variabl

原创 cnn驗證碼識別

import tensorflow as tf import os import pandas as pd def load_pics(filename_list): """ 1、讀取圖像數據,csv文件中的f

原创 批量修改文件名

import os import numpy as np data = [] #爲了方便,避免忘記close掉這個文件對象,可以用下面這種方式替代 with open(r'C:\Users\\Desktop\xiangmu.t

原创 mnist手寫體識別

import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data # import os def mnist_recognit