Code Monkey home page Code Monkey logo

demo-svhn-classifier's Introduction

demo-svhn-classifier

TL;DR: Tensorflow2 offers roughly 3 code styles of model implementation: Sequential, Functional and Subclassing. This project utilizes first style to implement SVHN dataset image classifier, whose level of abstraction is highest among the three. Scroll down to environment section to try out Streamlit demo of implemented image classifiers.

thumbnail


In any frameworks, high-level API sacrifices flexibility for implementation and makes overall code black-box if components are not well understood. However, purpose of it is to reduce amount of code implementation and therefore controlling overall system complexity.

This can also be applied when implementing neural network program in Tensorflow, since this framework provides APIs with wide spectrum of abstraction. For example, when execution logic which contains fixed number of linear steps(i.e. not iterative or autoregressive), this can be simply implemented by Keras Sequential class. Also, APIs for monitoring and controlling training process are prepared within Keras callbacks API.

Although there are APIs with lower level of abstraction to implement exactly same components, this project implements image classifiers using high-level Keras APIs to demonstrate the convenience and simplicity of them. Classifier with MLP, CNN architecture will be trained independently, and each of them will be saved with set of weights which provided best validation accuracy. After training classifiers, they can be examined with test data using Streamlit demo in local environment.

Environment

This application is scripted and tested on M2 Apple Silicon machine.

conda env create
conda activate svhn

There are two ways to prepare objects required two run the demo script.

1. Download from S3 (recommended)

For sake of users who want to try out this demo, two different pretrained models and corresponding CSV files of logs generated during training process are saved in my S3 repository. By executing main.py script using remote command, those objects can be downloaded from that repository, and you are ready to go.

python main.py remote

2. Run training script in local environment

Optionally, to train and save models in local machine, execute main.py script using local command. Either way, trained models and history files will be saved in directory specified in LOCAL_DIR variable of the main script.

python main.py local

Execute

To try out trained models, execute Streamlit demo as following.

streamlit run demo.py

demo-svhn-classifier's People

Contributors

sunsikim avatar

Watchers

 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.