Giter Site home page Giter Site logo

resnetae's Introduction

ResNet Auto-Encoder

This repository contains Tensorflow code for an Auto-Encoder architecture built with Residual Blocks.

Default Architecture Parameters:

model = ResNetAE(input_shape=(256, 256, 3),
                 n_ResidualBlock=8,
                 n_levels=4,
                 z_dim=128,
                 bottleneck_dim=128,
                 bUseMultiResSkips=True)
  • input_shape: A tuple defining the input image shape for the model
  • n_ResidualBlock: Number of Convolutional residual blocks at each resolution
  • n_levels: Number of scaling resolutions, at each increased resolution, the image dimension halves and the number of filters channel doubles
  • z_dim: Number of latent dim filters
  • bottleneck_dim: AE/VAE vectorized latent space dimension
  • bUseMultiResSkips: At each resolution, the feature maps are added to the latent/image output (green path in diagram)

Encoder

ResNetAE Encoder

The encoder expects a 4-D Image Tensor in the form of [Batch x Height x Width x Channels]. The output z would be of shape [Batch x Height/(2**n_levels) x Width/(2**n_levels) x z_dim].

encoder = ResNetEncoder(n_ResidualBlock=8, 
                        n_levels=4,
                        z_dim=10, 
                        bUseMultiResSkips=True)

N.B. It is possible to flatten z by tf.layers.dense for a vectorised latent space, as long as the shape is preserved for the decoder during the unflatten process.

Decoder

ResNetAE Decoder

The decoder expects a 4-D Feature Tensor in the form of [Batch x Height x Width x Channels]. The output x_out would be of the shape [Batch x Height*(2**n_levels) x Width*(2**n_levels) x output_channels]

decoder = ResNetDecoder(n_ResidualBlock=8, 
                        n_levels=4,
                        output_channels=3, 
                        bUseMultiResSkips=True)

Residual Block

The Residual Block uses the Full pre-activation ResNet Residual block by He et al.

TODO: implementation changed to Conv-Batch-Relu, update figure

ResNetAE Residual Block

If you find this work useful for your research, please cite:

@article{ResNetAE, 
  Title={{R}es{N}et{AE}-https://github.com/farrell236/ResNetAE}, 
  url={https://github.com/farrell236/ResNetAE},  
  Author={Hou, Benjamin}, 
  Year={2019}
}

resnetae's People

Contributors

farrell236 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.