lstm

Keras: LSTM with class weights

北慕城南 提交于 2020-01-12 06:26:50
问题 my question is quite closely related to this question but also goes beyond it. I am trying to implement the following LSTM in Keras where the number of timesteps be nb_tsteps=10 the number of input features is nb_feat=40 the number of LSTM cells at each time step is 120 the LSTM layer is followed by TimeDistributedDense layers From the question referenced above I understand that I have to present the input data as nb_samples, 10, 40 where I get nb_samples by rolling a window of length nb

Keras: LSTM with class weights

浪尽此生 提交于 2020-01-12 06:26:06
问题 my question is quite closely related to this question but also goes beyond it. I am trying to implement the following LSTM in Keras where the number of timesteps be nb_tsteps=10 the number of input features is nb_feat=40 the number of LSTM cells at each time step is 120 the LSTM layer is followed by TimeDistributedDense layers From the question referenced above I understand that I have to present the input data as nb_samples, 10, 40 where I get nb_samples by rolling a window of length nb

LSTM/GRU autoencoder convergency

我们两清 提交于 2020-01-11 07:57:08
问题 Goal I have a strange situation trying to create an efficient autoencoder over my time series dataset: X_train (200, 23, 178) X_val (100, 23, 178) X_test (100, 23, 178) Current situation With a simple autoencoder I have better results rather than my simple LSTM AE over a dataset of time series. I have some concerns about my utilization of the Repeat Vector wrapper layer, which as far as I understood, is supposed to repeat a number of times like the sequence length the last state of the LSTM

循环神经网络和LSTM

我们两清 提交于 2020-01-10 08:39:29
MENU 循环神经网络 定义 应用领域 模型结构 问题 LSTM 基本概念 核心思想 循环神经网络 定义 循环神经网络(Recurrent Neural Network, RNN)是一类以序列(sequence)数据为输入,在序列的演进方向进行递归(recursion)且所有节点(循环单元)按链式连接的递归神经网络(recursive neural network) 应用领域 RNN的应用领域有很多, 可以说只要考虑时间先后顺序的问题都可以使用RNN来解决.这里主要说一下几个常见的应用领域: 自然语言处理(NLP): 主要有视频处理, 文本生成, 语言模型, 图像处理 机器翻译, 机器写小说 语音识别 图像描述生成 文本相似度计算 音乐推荐、网易考拉商品推荐、Youtube视频推荐等新的应用领域. 模型结构 问题 RNN存在梯度消失和梯度爆炸问题(BP算法和长时间依赖造成的): RNN的算法, 它处理时间序列的问题的效果很好, 但是仍然存在着一些问题, 其中较为严重的是容易出现梯度消失或者梯度爆炸的问题(BP算法和长时间依赖造成的). 注意: 这里的梯度消失和BP的不一样,这里主要指由于时间过长而造成记忆值较小的现象. 因此, 就出现了一系列的改进的算法, 这里介绍主要的两种算法: LSTM 和 GRU. LSTM 和 GRU对于梯度消失或者梯度爆炸的问题处理方法主要是:

【笔记】论文阅读 | Optimization as a Model for Few-Shot Learning

我是研究僧i 提交于 2020-01-08 00:37:22
论文信息:Ravi S, Larochelle H. Optimization as a model for few-shot learning[J]. 2016. 博文作者: Veagau 编辑时间:2020年01月07日 本文是2017年ICLR的会议论文,作者来自Twitter公司。在论文中作者提出了一种用于少样本领域的基于LSTM的 元学习者(Meta-Learner) 模型,这种模型能够直接学习用于训练另外一个 学习者(Learner) ,如神经网络分类器,的优化算法。 少样本学习或者说元学习的关键是找到一种系统化的方法去学习在各种任务上有效的通用初始化方案,这种方案能够为基于待考虑数据上的任务提供一个良好的初始训练点,从而实现在新任务上的快速适应于收敛,即学会学习。文中提出的基于LSTM的元学习者模型,作为一个优化器的角色, 能够捕获任务内的短期知识以及跨任务的长期知识,进而形成跨任务共享的基础知识 ,最后作用在学习者上,使其能够在每个任务上都可以快速收敛到一个较优解。 标准的深度神经网络的优化算法采用梯度下降的思想。 \[ \theta_t = \theta_{t-1}-\alpha_t\nabla_{t-1}L_{t} \] LSTM细胞状态的更新有着类似的表示形式。 \[ c_t=f_t\odot c_{t-1}+i_t \odot \tilde{c_t} \]

How to improve the word rnn accuracy in tensorflow?

无人久伴 提交于 2020-01-07 06:47:51
问题 I'm working on a title auto generate project with tensorflow seq2seq.rnn_decoder. My training set is a big set of titles, each title is independent of each other and is not relevant. I had try two data format for training: F1. Use the fixed seq length in batch, and replace ‘\n’ to ‘<eos>’, and ‘<eos>’ index is 1, which training batch is like: [2,3,4,5,8,9,1,2,3,4], [88,99,11,90,1,5,6,7,8,10] F2. Use Variable seq length in batch, and add PAD 0 to keep the fixed length, which training batch is

【论文翻译】Deep Visual-Semantic Hashing for Cross-Modal Retrieval

笑着哭i 提交于 2020-01-06 17:57:25
Deep Visual-Semantic Hashing for Cross-Modal Retrieval 用于跨模态检索的深度视觉语义哈希 摘要: 由于哈希算法具有较高的存储和检索效率,在大规模多媒体检索中被广泛应用于近似近邻搜索。跨模态哈希能够有效地检索图像以响应文本查询,反之亦然,近年来受到越来越多的关注。现有的大多数跨模态哈希研究工作都没有捕捉到图像的空间依赖性和文本句子的时间动态,从而学习强大的特征表示和跨模态嵌入,从而缓解了不同模式的异质性。摘要提出了一种新的深度视觉语义哈希(DVSH)模型,该模型在端到端深度学习体系结构中生成图像和句子的紧凑哈希码,捕捉视觉数据与自然语言之间的内在跨模态对应关系。DVSH是一种混合的深度架构,它构成了一个用于学习图像和文本句子的联合嵌入空间的可视化语义融合网络,以及两个用于学习哈希函数以生成紧凑二进制代码的特定于模态的哈希网络。我们的架构有效地统一了联合多模态嵌入和交叉模态哈希,它是基于图像上的卷积神经网络、句子上的递归神经网络和一个结构化的最大裕度目标的新组合,该目标将所有东西集成在一起,从而能够学习保持相似性和高质量的哈希码。大量的经验证据表明,我们的DVSH方法在图像-句子数据集的跨模态检索实验中,即标准的IAPR TC-12和大规模的Microsoft COCO中,得到了最先进的结果。 1.介绍 而海量

Keras: Categorical vs Continuous input to a LSTM

▼魔方 西西 提交于 2020-01-06 09:56:10
问题 I am new to Keras and deep learning and after going through several tutorials and answers on stackoverflow, I am still unclear about how the input is manipulated once entering the network. I am using the functional API of keras to develop complex models, so my first layer is always input layer. Something like: Input() LSTM() Dense() Now lets say I have 2 training datasets A and B. Each dataset is identical 10,000 by 6,000 matrix with 200 distinct values in it. i.e 10,000 rows each

Keras: Categorical vs Continuous input to a LSTM

喜夏-厌秋 提交于 2020-01-06 09:55:07
问题 I am new to Keras and deep learning and after going through several tutorials and answers on stackoverflow, I am still unclear about how the input is manipulated once entering the network. I am using the functional API of keras to develop complex models, so my first layer is always input layer. Something like: Input() LSTM() Dense() Now lets say I have 2 training datasets A and B. Each dataset is identical 10,000 by 6,000 matrix with 200 distinct values in it. i.e 10,000 rows each

Keras time series can I predict next 6 month in one time

ぐ巨炮叔叔 提交于 2020-01-06 05:38:07
问题 I use keras for time series prediction. My code can predict next 6 months by predict next one month and then get it to be input for predict next month again untill complete 6 months. That means predict one month 6 times. Can I predict next 6 month in one time. import pandas as pd import numpy as np import matplotlib.pyplot as plt from keras.layers import LSTM from pandas.tseries.offsets import MonthEnd from sklearn.preprocessing import MinMaxScaler from keras.models import Sequential from