Pytorch implementation of the Variational Recurrent Neural Network (VRNN).

Overview

VariationalRecurrentNeuralNetwork

Pytorch implementation of the Variational RNN (VRNN), from A Recurrent Latent Variable Model for Sequential Data.

The paper is available here.

png

Run:

To train: python train.py

To sample with saved model: python sample.py [saves/saved_state_dict_name.pth]

Some samples:

png

Comments
  • Repackaging of states necessary?

    Repackaging of states necessary?

    Hi,

    in the VRNN class (in model.py), you cut the gradients behind h_{t-1} using the _repackage_state() function. I've been thinking about this question for a while now and would have said that the correct thing to do is to not cut the gradients because nothing in the paper indicates that one should.

    May I ask what your reasoning is? - I'm not very sure about mine.

    Thanks! Best, Max

    opened by maximilianigl 1
  • nll loss maybe got nan

    nll loss maybe got nan

    the code def _nll_bernoulli(self, theta, x): return - torch.sum(x*torch.log(theta + EPS) + (1-x)*torch.log(1-theta-EPS)) may got nan loss. i think it should be def _nll_bernoulli(self, theta, x): return - torch.sum(x*torch.log(theta + EPS) + (1-x)*torch.log(1-theta+EPS))

    opened by jvnext 0
  • The dim of the data

    The dim of the data

    When load the data from the dataloader, the dim is transposed: data = Variable(data.squeeze().transpose(0, 1)).to(device) So in model.py line 82

     for t in range(x.size(0)):
    
    	phi_x_t = self.phi_x(x[t])
    

    the size of phi_x_t is ( batch_size, h_dim ), is that correct ?

    opened by RuifMaxx 0
  • i have some question

    i have some question

    Error message :

    Done! Traceback (most recent call last): File "train.py", line 112, in train(epoch) File "train.py", line 25, in train data = (data - data.min().data[0]) / (data.max().data[0] - data.min().data[0]) IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number

    so , I changed the code (as below)

    data.min().data[0] -> data.min()

    *.data[0] -> *.item() ( * Denotes all variables that use data [0].)

    Does this deviate from your intention in your code? @emited

    opened by ghost 1
  • clipping before optimizing step.

    clipping before optimizing step.

    @emited Please check and let me know.

    1. Added clipping before the optimizer step.
    2. Updated with .item() rather than .data[0]
    3. Input is normalized but the reconstruction is done for the unnormalized image so this is removed
    4. Loss get's NAN sometimes and so added 1e-5 as epsilon in the std2 denominator
    opened by srinadhu 0
  • loss got nan.

    loss got nan.

    Train Epoch: 3 [0/60000 (0%)] KLD Loss: 2.687659 NLL Loss: 73.599564 Train Epoch: 3 [2800/60000 (21%)] KLD Loss: 2.976363 NLL Loss: 78.757454 Train Epoch: 3 [5600/60000 (43%)] KLD Loss: 2.837864 NLL Loss: 78.958122 Train Epoch: 3 [8400/60000 (64%)] KLD Loss: nan NLL Loss: nan Train Epoch: 3 [11200/60000 (85%)] KLD Loss: nan NLL Loss: nan ====> Epoch: 3 Average loss: nan ====> Test set loss: KLD Loss = nan, NLL Loss = nan Train Epoch: 4 [0/60000 (0%)] KLD Loss: nan NLL Loss: nan

    opened by kunrenzhilu 5
Owner
emmanuel
emmanuel
Recurrent Variational Autoencoder that generates sequential data implemented with pytorch

Pytorch Recurrent Variational Autoencoder Model: This is the implementation of Samuel Bowman's Generating Sentences from a Continuous Space with Kim's

Daniil Gavrilov 347 Nov 14, 2022
Bayesian-Torch is a library of neural network layers and utilities extending the core of PyTorch to enable the user to perform stochastic variational inference in Bayesian deep neural networks

Bayesian-Torch is a library of neural network layers and utilities extending the core of PyTorch to enable the user to perform stochastic variational inference in Bayesian deep neural networks. Bayesian-Torch is designed to be flexible and seamless in extending a deterministic deep neural network architecture to corresponding Bayesian form by simply replacing the deterministic layers with Bayesian layers.

Intel Labs 210 Jan 4, 2023
PyTorch implementation of the Quasi-Recurrent Neural Network - up to 16 times faster than NVIDIA's cuDNN LSTM

Quasi-Recurrent Neural Network (QRNN) for PyTorch Updated to support multi-GPU environments via DataParallel - see the the multigpu_dataparallel.py ex

Salesforce 1.3k Dec 28, 2022
Pytorch implementation of "Attention-Based Recurrent Neural Network Models for Joint Intent Detection and Slot Filling"

RNN-for-Joint-NLU Pytorch implementation of "Attention-Based Recurrent Neural Network Models for Joint Intent Detection and Slot Filling"

Kim SungDong 194 Dec 28, 2022
PyTorch implementation of Hierarchical Multi-label Text Classification: An Attention-based Recurrent Network

hierarchical-multi-label-text-classification-pytorch Hierarchical Multi-label Text Classification: An Attention-based Recurrent Network Approach This

Mingu Kang 17 Dec 13, 2022
An implementation of DeepMind's Relational Recurrent Neural Networks in PyTorch.

relational-rnn-pytorch An implementation of DeepMind's Relational Recurrent Neural Networks (Santoro et al. 2018) in PyTorch. Relational Memory Core (

Sang-gil Lee 241 Nov 18, 2022
OHLC Average Prediction of Apple Inc. Using LSTM Recurrent Neural Network

Stock Price Prediction of Apple Inc. Using Recurrent Neural Network OHLC Average Prediction of Apple Inc. Using LSTM Recurrent Neural Network Dataset:

Nouroz Rahman 410 Jan 5, 2023
Speech Separation Using an Asynchronous Fully Recurrent Convolutional Neural Network

Speech Separation Using an Asynchronous Fully Recurrent Convolutional Neural Network This repository is the official implementation of Speech Separati

Kai Li (李凯) 116 Nov 9, 2022
A real world application of a Recurrent Neural Network on a binary classification of time series data

What is this This is a real world application of a Recurrent Neural Network on a binary classification of time series data. This project includes data

Josep Maria Salvia Hornos 2 Jan 30, 2022
LBK 20 Dec 2, 2022
Space Time Recurrent Memory Network - Pytorch

Space Time Recurrent Memory Network - Pytorch (wip) Implementation of Space Time Recurrent Memory Network, recurrent network competitive with attentio

Phil Wang 50 Nov 7, 2021
Official implementation for NIPS'17 paper: PredRNN: Recurrent Neural Networks for Predictive Learning Using Spatiotemporal LSTMs.

PredRNN: A Recurrent Neural Network for Spatiotemporal Predictive Learning The predictive learning of spatiotemporal sequences aims to generate future

THUML: Machine Learning Group @ THSS 243 Dec 26, 2022
PyTorch implementation DRO: Deep Recurrent Optimizer for Structure-from-Motion

DRO: Deep Recurrent Optimizer for Structure-from-Motion This is the official PyTorch implementation code for DRO-sfm. For technical details, please re

Alibaba Cloud 56 Dec 12, 2022
The first public PyTorch implementation of Attentive Recurrent Comparators

arc-pytorch PyTorch implementation of Attentive Recurrent Comparators by Shyam et al. A blog explaining Attentive Recurrent Comparators Visualizing At

Sanyam Agarwal 150 Oct 14, 2022
PyTorch Autoencoders - Implementing a Variational Autoencoder (VAE) Series in Pytorch.

PyTorch Autoencoders Implementing a Variational Autoencoder (VAE) Series in Pytorch. Inspired by this repository Model List check model paper conferen

Subin An 8 Nov 21, 2022
the code of the paper: Recurrent Multi-view Alignment Network for Unsupervised Surface Registration (CVPR 2021)

RMA-Net This repo is the implementation of the paper: Recurrent Multi-view Alignment Network for Unsupervised Surface Registration (CVPR 2021). Paper

Wanquan Feng 205 Nov 9, 2022
Stacked Recurrent Hourglass Network for Stereo Matching

SRH-Net: Stacked Recurrent Hourglass Introduction This repository is supplementary material of our RA-L submission, which helps reviewers to understan

null 28 Jan 3, 2023
Source Code for our paper: Understand me, if you refer to Aspect Knowledge: Knowledge-aware Gated Recurrent Memory Network

KaGRMN-DSG_ABSA This repository contains the PyTorch source Code for our paper: Understand me, if you refer to Aspect Knowledge: Knowledge-aware Gated

XingBowen 4 May 20, 2022
This is the official Pytorch implementation of "Lung Segmentation from Chest X-rays using Variational Data Imputation", Raghavendra Selvan et al. 2020

README This is the official Pytorch implementation of "Lung Segmentation from Chest X-rays using Variational Data Imputation", Raghavendra Selvan et a

Raghav 42 Dec 15, 2022