Coder Social home page Coder Social logo

picogan's Introduction

picoGAN ๐Ÿง 

A very small GAN for unsupervised learning

Two simple models to demonstrate both a traditional dense neural network, and a generative adversarial network (GAN) for fraud detection. The dataset contains preprocessed banknote images, reduced to four numeric features and a single label. Refer to the original data source for further details.

The Models

naive.py

A very small fully connected neural network for learning classification on the unaltered balanced dataset. The network of (4 > 16 > 1) nodes trains to ~99% accuracy in 10 epochs.

Fairly straightforward.

gan.py

A very small GAN for learning classification on the legitimate half of the dataset only! By constructing two neural networks, we set up a training competition between them. The generator learns to create banknotes from noise, while the discriminator learns to tell real banknotes apart from the generator's fake output.

After 600 epochs, the generator's banknotes look pretty real to the discriminator, but the discriminator is getting pretty good at telling the real from the fake!

Can a neural network learn to identify fraudulent banknotes without ever seeing one? Run gan.py to find out!

Usage

  1. Install Python 3 if not already
  2. Create/activate a virtual environment and install deps:
$ cd picoGan/
$ python3 -m venv venv
$ source venv/bin/activate
(venv) $ pip install -r requirements.txt
  1. Run the demos
(venv) $ python naive.py
(venv) $ python gan.py
  1. Tweak and experiment!

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.