深度学习5-RNN
DL
HJZ11
记录学习之路,欢迎交流
展开
-
5-RNN-01_字符集RNN
"""单词字符级别预测RNN"""import timefrom collections import namedtupleimport numpy as npimport tensorflow as tfimport oswith open('../datas/anna.txt', 'r') as f: text = f.read()vocab = sort...原创 2020-02-14 13:07:52 · 242 阅读 · 0 评论 -
5-RNN-02_RNN基本api
import tensorflow as tf"""tf.nn.rnn_cell # 定义rnn 细胞核相关的信息的tf.nn.rnn_cell_impl # 定义rnn细胞核具体是如何实现的tf.nn.dynamic_rnn() # 单向动态rnn。tf.nn.bidirectional_dynamic_rnn() # 双向动态rnntf.nn.st...原创 2020-02-18 10:21:05 · 265 阅读 · 0 评论 -
5-RNN-03_双向rnn_英文小短文
import osimport numpy as npimport tensorflow as tfdef load_data(file_path): """ 加载原始数据 :param file_path: :return: """ with open(file_path, 'r') as reader: data = ...原创 2020-02-18 10:53:50 · 271 阅读 · 0 评论 -
5-RNN-04_词向量
# Embedding Skip-gramimport timeimport numpy as npimport tensorflow as tffrom utils import utilsfrom urllib.request import urlretrievefrom os.path import isfile, isdirfrom tqdm import tqdmi...原创 2020-02-18 11:27:59 · 194 阅读 · 0 评论 -
5-RNN-0501_英文情感分析
import numpy as npimport tensorflow as tffrom string import punctuationfrom collections import Counter# 介绍预览该项目,并介绍该项目网络结构!with open('../datas/sentiment/reviews.txt', 'r') as f: reviews =...原创 2020-02-18 12:06:02 · 264 阅读 · 0 评论 -
5-RNN-0502_中文情感分析
import numpy as npimport matplotlib.pyplot as pltimport reimport jiebaimport osfrom sklearn.model_selection import train_test_splitfrom gensim.models import KeyedVectorsfrom keras.models impo...原创 2020-02-18 12:06:57 · 557 阅读 · 1 评论 -
5-RNN-06_剧本生成项目
"""项目:电视剧本生成。数据集:https://www.kaggle.com/wcukierski/the-simpsons-by-the-data提交时间:12月29日之前。 提交邮箱:yingjun@ibefeing.com"""from utils import helperimport numpy as npimport warningsfrom tensorflow...原创 2020-02-18 12:12:48 · 376 阅读 · 1 评论 -
5-RNN-07_多GPU使用
"""演示多GPU使用"""import tensorflow as tffrom tensorflow.examples.tutorials.mnist import input_dataimport cv2import numpy as npimport osimport matplotlib.pyplot as pltFLAGS = tf.app.flags.FL...原创 2020-02-18 12:16:47 · 253 阅读 · 0 评论