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
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
-- | |
-- 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() |
-- Simple Sentence Similarity Example with Siamese Encoder | |
-- Author: Joost van Doorn (joostvandoorn.com) | |
require 'nn' | |
require 'rnn' | |
require 'io' | |
local pl = require 'pl' | |
local dl = require 'dataload' | |
-- Options | |
local opt = {} |
0.023262095961369 | |
0.043782837063209 | |
0.092482087101952 | |
0.18747380309514 | |
0.36381674030978 | |
0.70580721911491 | |
1.1544929836985 | |
1.7231447811158 | |
2.396492313429 | |
2.9533659130322 |
Copyright (c) 2016, Joost van Doorn | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions are met: | |
1. Redistributions of source caode must retain the above copyright notice, this | |
list of conditions and the following disclaimer. | |
2. Redistributions in binary form must reproduce the above copyright notice, | |
this list of conditions and the following disclaimer in the documentation |
------------------------------------------------------------------------ | |
--[[ SequencerCriterion ]]-- | |
-- Applies a criterion to each of the inputs and targets in the | |
-- corresponding input and target Tables. | |
-- Useful for nn.Repeater and nn.Sequencer. | |
-- WARNING : assumes that the decorated criterion is stateless, i.e. | |
-- the backward doesn't need to be preceded by a commensurate forward. | |
------------------------------------------------------------------------ | |
local SequencerCriterion, parent = torch.class('nn.SequencerCriterion', 'nn.Criterion') |
--[[ | |
Example of "coupled" separate encoder and decoder networks using cudnn, e.g. for sequence-to-sequence networks. | |
]]-- | |
require 'rnn' | |
require 'cunn' | |
require 'cudnn' |
local rnntest = {} | |
local precision = 1e-5 | |
local mytester | |
local benchmark = false | |
local makeOldRecurrent_isdone = false | |
function rnntest.encoderdecoder() | |
torch.manualSeed(123) |
package Test; | |
import static io.grpc.stub.ClientCalls.asyncUnaryCall; | |
import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; | |
import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; | |
import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; | |
import static io.grpc.stub.ClientCalls.blockingUnaryCall; | |
import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; | |
import static io.grpc.stub.ClientCalls.futureUnaryCall; | |
import static io.grpc.MethodDescriptor.generateFullMethodName; |
package org.deeplearning4j.examples.regression | |
import org.canova.api.records.reader.RecordReader | |
import org.canova.api.records.reader.impl.CSVRecordReader | |
import org.canova.api.split.FileSplit | |
import org.deeplearning4j.datasets.canova.RecordReaderDataSetIterator | |
import org.deeplearning4j.datasets.iterator.DataSetIterator | |
import org.deeplearning4j.nn.api.OptimizationAlgorithm | |
import org.deeplearning4j.nn.conf.{ MultiLayerConfiguration, NeuralNetConfiguration } | |
import org.deeplearning4j.nn.conf.Updater |