diff options
author | Anthony Wang | 2022-02-25 11:02:21 -0600 |
---|---|---|
committer | Anthony Wang | 2022-02-25 11:02:21 -0600 |
commit | e15c638bfb8f3ae5124c25af3633896c1a82e373 (patch) | |
tree | 33ca14193dc7522c35e7ee3825b02548295e0467 /src | |
parent | 804f22d05a18ae1baadf4d90371a1baca3bd9098 (diff) |
Old variable autoencoder that I wrote 6 weeks ago
Diffstat (limited to 'src')
-rw-r--r-- | src/vae.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/vae.rs b/src/vae.rs new file mode 100644 index 0000000..2fc6ae8 --- /dev/null +++ b/src/vae.rs @@ -0,0 +1,13 @@ +use tch::nn::{Module, OptimizerConfig}; +use tch::{kind, nn, Device, Tensor}; + +pub fn vae(vs: &nn::Path) -> impl Module { + nn::seq() + .add(nn::linear(vs, 100, 50, Default::default())) + .add_fn(|xs| xs.relu()) + .add(nn::linear(vs, 50, 10, Default::default())) + .add_fn(|xs| xs.relu()) + .add(nn::linear(vs, 10, 50, Default::default())) + .add_fn(|xs| xs.relu()) + .add(nn::linear(vs, 50, 100, Default::default())) +} |