Skip to content

Instantly share code, notes, and snippets.

@shijie-wu
shijie-wu / README.md
Created November 30, 2016 05:21 — forked from JoostvDoorn/README.md
hiddenOutput cudnn LSTM

Simple test to figure out the format of hiddenOutput of cudnn LSTM, see the file below.

hiddenOutput of normal LSTM

(1,.,.) =
  0.3042  0.3042  0.3042
[torch.CudaTensor of size 1x1x3]

hiddenOutput of bidirection LSTM

@shijie-wu
shijie-wu / convert.lua
Created November 30, 2016 05:21 — forked from JoostvDoorn/convert.lua
Conversion between SeqLSTM and cudnn LSTM
--
-- Author: Joost van Doorn <joost.vandoorn@student.uva.nl>
--
require 'rnn'
require 'cudnn'
function toCudnnLSTM(seqLSTM)
local rnn = cudnn.LSTM(seqLSTM.inputsize, seqLSTM.outputsize, 1)
local H, R, D = seqLSTM.outputsize, seqLSTM.outputsize, seqLSTM.inputsize
local biases = rnn:biases()
--[[
Example of "coupled" separate encoder and decoder networks using cudnn, e.g. for sequence-to-sequence networks.
]]--
require 'rnn'
require 'cunn'
require 'cudnn'
<html>
<title>
SQLite Example
</title>
<body>
<FORM ACTION="/create" METHOD=POST>
Name: <input type="text" name="name">
Marks: <input type="text" name="marks">