Coder Social home page Coder Social logo

deepcnn-tf2's Introduction

Examples for Tensorflow v2

Tensorflow v2 examples of baseline networks.

0. Requirements

  • python=3.7
  • tensorflow=2.2.0
  • numpy=1.18.8
  • cudatoolkit=10.1.243
  • cudnn=7.6.5
  • opencv=3.4.2
  • tqdm

1. Datasets

  • mnist (Auto-download): 60000 training images with shape 28x28 and 10000 test images.
  • Cifar (Auto-download): 60000 training

2. Training/Evaluating Model

2.1 Start with Tensorflow v2

Training a simple CNN model with the API fit() of the tf.Keras:

Usage: python xxx.py <mode> <gpu> [options]

python main_mini_cnn7layers.py train 0

Test model with test dataset:

python main_mini_cnn7layers.py test 0

2.2 Custom training/testing loop

python main_custom.py train

2.3 Start Tensorboard

tensorboard --logdir ./model_dir --port 16006
# Expore to the network
tensorboard --logdir ./model_dir --port 16006 --host 0.0.0.0

3. Visualization Data with Tensorboard Projector

python projector/mnist/main_cnn7layers.py
# With sprite image
python projector/mnist/main_cnn7layers.py -s

Open terminal in projector/mnist/dst_ckpt and open tensorboard by

tensorboard --logdir ./

Open browser with address: http://localhost:6006/#projector

Results in 2D (MNIST embedding):

mnist embedding

4 LDA loss

Reference:

Dorfer M, Kelz R, Widmer G. Deep linear discriminant analysis[J]. arXiv preprint arXiv:1511.04707, 2015.

python main_lda.py train

deepcnn-tf2's People

Contributors

jarvis73 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  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.