Comments (4)
今のままでもReshapeを駆使して実装可能.
ただし,ミニバッチの場合データがずれるという問題がある.
x = lasagne.layers.InputLayer((None, dim_x))
q1 = lasagne.layers.ReshapeLayer(x, (-1, timesteps, dim_x))
q2 = lasagne.layers.GRULayer(q1,num_units=dim_z, grad_clipping=100)
q3 = lasagne.layers.SliceLayer(q2,indices=-1,axis=1)
mean = lasagne.layers.DenseLayer(q3,2,nonlinearity=lasagne.nonlinearities.linear)
var = lasagne.layers.DenseLayer(q3,2,nonlinearity=lasagne.nonlinearities.softplus)
q = Gaussian(mean,var,given=[x])
z = lasagne.layers.InputLayer((None, dim_z))
p1 = RepeatLayer(z, n=timesteps)
p2 = lasagne.layers.GRULayer(p1, num_units=dim_x, grad_clipping=100)
p3 = lasagne.layers.ReshapeLayer(p2, (-1, [2]))
mean = lasagne.layers.DenseLayer(p3, dim_x, nonlinearity=lasagne.nonlinearities.softmax)
p = Categorical(mean,given=[z])
model = VAE(q,p,batch_size*20,lasagne.updates.adam,random=1234)
from tars.
関連して,RepeatLayerをlayerに加える(上のコードでも使用).
from tars.
これでRNN-based VAEが実装可能.
x = lasagne.layers.InputLayer((None, timesteps, dim_x))
q1 = lasagne.layers.GRULayer(x, num_units=dim_z, grad_clipping=100)
q2 = lasagne.layers.SliceLayer(q1, indices=-1, axis=1)
mean = lasagne.layers.DenseLayer(q2,2,nonlinearity=lasagne.nonlinearities.linear)
var = lasagne.layers.DenseLayer(q2,2,nonlinearity=lasagne.nonlinearities.softplus)
q = Gaussian(mean,var,given=[x])
z = lasagne.layers.InputLayer((None, dim_z))
p1 = RepeatLayer(z, n=timesteps)
p2 = lasagne.layers.GRULayer(p1, num_units=dim_x, grad_clipping=100)
p3 = lasagne.layers.ReshapeLayer(p2, (-1, [2]))
p4 = lasagne.layers.DenseLayer(p3, dim_x, nonlinearity=lasagne.nonlinearities.softmax)
mean = lasagne.layers.ReshapeLayer(p4, (-1, timesteps, dim_x))
p = Categorical(mean,given=[z])
model = VAE(q,p,batch_size,adam,random=1234)
ただし,toy problemで何故かあまり再構成が良くない.
from tars.
とりあえず実装できるようになったので,閉じます.
from tars.
Related Issues (20)
- Create a superclass of VAE and GAN, etc.
- Create various distributions
- Implement the Langevin dynamics for sampling the latent features HOT 2
- Implement KL cost annealing HOT 4
- Implement the DRAW model HOT 6
- Release date HOT 1
- Implement the VRNN model
- Add docstrings HOT 2
- Improve API
- Improve class inheritance structure
- Implement the JMVAE models on this version
- Add unit tests for DistributionSample classes
- Fix multi-latent layers
- Add the prior class
- "test_consistency" test cases failing on servers
- Add unit tests for distribution models
- Generative adversarial nets as implicit distribution
- Use floatX for temperature in ConcreteSample
- About convolutional operation HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tars.