Coder Social home page Coder Social logo

spectrally-normalized-gan-flowers102's Introduction

Generating Flowers - Using Spectrally Normalized GAN

This repository contains the Spectrally Normalized (SN) GAN architecture, model weights and training resuls. SN-GAN is based on the paper Spectral Normalization for Generative Adversarial Networks.

Architecture Details

SN-GAN uses spectral normalization, which is a weight normalization technique, to stabilize the training of Discriminator. The spectral norm of a weight matrix W can be obtained by Singular Value Decomposition (SVD), which helps finding the matrix's largest singular value.

Once the largest singular value is obtained, it is divided by every value in the weight matrix.

  • In pytorch, we use torch.nn.utils.spectral_norm which is wrapped around each nn.Conv2d layer

Unlike batch norm, which is used to normalize the activations of each layer, spectral norm normalizes the weights of each layer.

Dataset

I have used Flowers102 (Oxford 102 Flower) dataset. It is available by calling torchvision.datasets.Flowers102. It consists of 102 flower categories. The flowers were chosen to be flowers commonly occurring in the United Kingdom. I have resized the images to 64 x 64 for faster training.

Results

Below are some generated flowers after 20, 120 and 200 epochs of training respectively:


20 epochs



120 epochs



200 epochs



Feel free to load the model weights and generate some flowers ;)

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.