lstm

How do you pass video features from a CNN to an LSTM?

徘徊边缘 提交于 2019-11-30 09:17:55
After you pass a video frame through a convnet and get an output feature map, how do you pass that data into an LSTM? Also, how do you pass multiple frames to the LSTM thru the CNN? In other works I want to process video frames with an CNN to get the spatial features. Then I want pass these features to an LSTM to do temporal processing on the spatial features. How do I connect the LSTM to the video features? For example if the input video is 56x56 and then when passed through all of the CNN layers, say it comes out as 20: 5x5's. How are these connected to the LSTM on a frame by frame basis?

Multilayer Seq2Seq model with LSTM in Keras

▼魔方 西西 提交于 2019-11-30 07:17:44
I was making a seq2seq model in keras. I had built single layer encoder and decoder and they were working fine. But now I want to extend it to multi layer encoder and decoder. I am building it using Keras Functional API. Training:- Code for encoder:- encoder_input=Input(shape=(None,vec_dimension)) encoder_lstm=LSTM(vec_dimension,return_state=True,return_sequences=True)(encoder_input) encoder_lstm=LSTM(vec_dimension,return_state=True)(encoder_lstm) encoder_output,encoder_h,encoder_c=encoder_lstm Code for decoder:- encoder_state=[encoder_h,encoder_c] decoder_input=Input(shape=(None,vec_dimension

论文阅读 | DeepDrawing: A Deep Learning Approach to Graph Drawing

我怕爱的太早我们不能终老 提交于 2019-11-30 06:32:06
作者:Yong Wang, Zhihua Jin, Qianwen Wang, Weiwei Cui, Tengfei Ma and Huamin Qu 本文发表于VIS2019, 来自于香港科技大学的可视化小组(屈华民教授领导)的研究 1. 简介 图数据广泛用于各个领域,例如生物信息学,金融和社交网络分析。在过去的五十年中,已经提出了许多图布局算法,来满足所需的视觉要求,例如更少的边缘交叉,更少的节点遮挡以及更好的聚团保护。传统的图布局算法大致可以分为两个方向:基于弹簧,能量模型和基于降维模型。当用户使用特定的图布局时,取得好的可视化效果往往需要许多参数的实验,对于没有相关经验的用户来说,是一个不小的挑战。由于特定于算法的参数和布局效果通常取决于输入的图结构,因此我们考虑是否可以使用 深度学习 来学习别人的布局算法。 这个问题有以下三个挑战: 模型选择: 图布局算法不同与普通的分类问题,它的输入是复杂的图结构,输出是点的坐标(不定长二维数组)。 损失函数设计: 图布局的结果很难判断好坏(很多时候是主观的印象),除此之外,图布局通过旋转和放缩之后,依然具有相同的结构。 训练数据的缺少:不同于图像领域有 Imagenet, MNIST 等数据集,图布局算法并没有这方面的数据集 本文提出一种 基于graph-LSTM的方法来直接根据输入图的拓扑结构生成图布局结果 。本文使用广度优先搜索

What is num_units in tensorflow BasicLSTMCell?

梦想的初衷 提交于 2019-11-30 06:11:29
问题 In MNIST LSTM examples, I don't understand what "hidden layer" means. Is it the imaginary-layer formed when you represent an unrolled RNN over time? Why is the num_units = 128 in most cases ? I know I should read colah's blog in detail to understand this, but, before that, I just want to get some code working with a sample time series data I have. 回答1: The number of hidden units is a direct representation of the learning capacity of a neural network -- it reflects the number of learned

How to deal with multi step time series forecasting in multivariate LSTM in keras

喜夏-厌秋 提交于 2019-11-30 05:31:47
I am trying to do multi-step time series forecasting using multivariate LSTM in Keras. Specifically, I have two variables (var1 and var2) for each time step originally. Having followed the online tutorial here , I decided to use data at time (t-2) and (t-1) to predict the value of var2 at time step t. As sample data table shows, I am using the first 4 columns as input, Y as output. The code I have developed can be seen here , but I have got three questions. var1(t-2) var2(t-2) var1(t-1) var2(t-1) var2(t) 2 1.5 -0.8 0.9 -0.5 -0.2 3 0.9 -0.5 -0.1 -0.2 0.2 4 -0.1 -0.2 -0.3 0.2 0.4 5 -0.3 0.2 -0.7

LSTM - Making predictions on partial sequence

五迷三道 提交于 2019-11-30 05:21:38
问题 This question is in continue to a previous question I've asked. I've trained an LSTM model to predict a binary class (1 or 0) for batches of 100 samples with 3 features each, i.e: the shape of the data is (m, 100, 3), where m is the number of batches. Data: [ [[1,2,3],[1,2,3]... 100 sampels], [[1,2,3],[1,2,3]... 100 sampels], ... avaialble batches in the training data ] Target: [ [1] [0] ... ] Model code: def build_model(num_samples, num_features, is_training): model = Sequential() opt =

LSTM with Keras for mini-batch training and online testing

删除回忆录丶 提交于 2019-11-30 03:49:35
I would like to implement an LSTM in Keras for streaming time-series prediction -- i.e., running online, getting one data point at a time. This is explained well here , but as one would assume, the training time for an online LSTM can be prohibitively slow. I would like to train my network on mini-batches, and test (run prediction) online. What is the best way to do this in Keras? For example, a mini-batch could be a sequence of 1000 data values ( [33, 34, 42, 33, 32, 33, 36, ... 24, 23] ) that occur at consecutive time steps. To train the network I've specified an array X of shape (900, 100,

LSTM 长短期记忆

為{幸葍}努か 提交于 2019-11-30 03:23:15
LSTM是RNN的变形,也就是循环神经网络的形式之一,主要解决传统RNN记忆不了太长时间数据问题(像是一个容易遗忘的老人,记不住太久远之前的信息,所以就出现了LSTM,让他只记住有用的信息) 传统RNN的问题分析:比如输入文本是我今天要做红烧排骨,首先要准备排骨,然后…,最后一道美味的菜就出锅了.这个时候我们要让RNN来判断我们到底做了什么菜,RNN可能给出辣子鸡这个答案,然后就反向的去推导误差,如果每一步误差都小于1,那么等到连乘反向到t1,误差就消失了,这叫梯度消失,如果每一步的误差都大于1,那么反向到t1的时候,误差就变成了一个无穷大的数,就把RNN撑死了,这叫梯度爆炸(虽然可以用剪裁来解决) 梯度消失: 梯度爆炸: 为了解决上面出现的梯度消失和梯度爆炸的问题,就出现了LSTM(长短期记忆) 具体LSTM模型是怎么实现的呢? 相对于传统的RNN,LSTM的输入有x(t),a(t-1),x(t)变成了x(t),a(t-1),c(t-1),不仅仅是参数数量上的变化,还有就是 a(t-1)的求法也不一样,下面是LSTM一个cell的计算过程 来源: https://blog.csdn.net/weixin_43027596/article/details/101022774

Keras using Tensorflow backend— masking on loss function

£可爱£侵袭症+ 提交于 2019-11-30 03:07:59
I am trying to implement a sequence-to-sequence task using LSTM by Keras with Tensorflow backend. The inputs are English sentences with variable lengths. To construct a dataset with 2-D shape [batch_number, max_sentence_length], I add EOF at the end of line and pad each sentence with enough placeholders, e.g. "#". And then each character in sentence is transformed to one-hot vector, now the dataset has 3-D shape [batch_number, max_sentence_length, character_number]. After LSTM encoder and decoder layers, softmax cross entropy between output and target is computed. To eliminate the padding

自然语言处理的发展历程

女生的网名这么多〃 提交于 2019-11-30 02:01:22
NLP的发展趋势:规则—>统计—>深度学习。 自然语言处理的发展大致经历了4个阶段:1956年以前的萌芽期;1957-1970年的快速发展期;1971 -1993年的低谷的发展期和1994年至今的复苏融合期。 一、萌芽期(1956年以前) 1956年以前,可以看作自然语言处理的基础研究阶段。一方面,人类文明经过了几千年的发展,积累了大量的数学、语言学和物理学知识。这些知识不仅是计算机诞生的必要条件,同时也是自然语言处理的理论基础。另一方面,阿兰·图灵在1936年首次提出了“图灵机”的概念。“图灵机”作为计算机的理论基础,促使了1946年电子计算机的诞生。而电子计算机的诞生又为机器翻译和随后的自然语言处理提供了物质基础。 由于来自机器翻译的社会需求,这一时期也进行了许多自然语言处理的基础研究。1948年Shannon把离散马尔可夫过程的概率模型应用于描述语言的自动机。接着,他又把热力学中“熵”(entropy)的概念引用于语言处理的概率算法中。上世纪50年代初,Kleene研究了有限自动机和正则表达式。1956年,Chomsky又提出了上下文无关语法,并把它运用到自然语言处理中。他们的工作直接引起了基于规则和基于概率这两种不同的自然语言处理技术的产生。而这两种不同的自然语言处理方法,又引发了数十年有关基于规则方法和基于概率方法孰优孰劣的争执。 另外