Skip to content

Commit

Permalink
Implement Autoencoder class
Browse files Browse the repository at this point in the history
  • Loading branch information
alimoezzi committed Aug 1, 2021
1 parent 346b835 commit f88b91a
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions mnist_autoencoder.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,37 @@
"name": "#%%\n"
}
}
},
{
"cell_type": "markdown",
"source": [
"### Autoencoder class"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": 7,
"outputs": [],
"source": [
"class Autoencoder(nn.Module):\n",
" def __init__(self, latent_dims):\n",
" super(Autoencoder, self).__init__()\n",
" self.encoder = Encoder(latent_dims)\n",
" self.decoder = Decoder(latent_dims)\n",
"\n",
" def forward(self, x):\n",
" z = self.encoder(x)\n",
" return self.decoder(z)"
],
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
}
}
],
"metadata": {
Expand Down

0 comments on commit f88b91a

Please sign in to comment.