Code Monkey home page Code Monkey logo

cdsw-caltech-gpu's Introduction

This project contains examples of transfer learning using convolutional neural networks trained on the Imagenet dataset and repurposed to identify objects from the Caltech256 dataset. Various open-source DL frameworks are used and leverage GPU acceleration to perform this task. The example here is exactly the same as the exercise described in this blog post from the Cloudera Engineering blog.

Download and store source data

The same data is used across all frameworks. Prepare this data initially by executing the code in dataprep.py.

Featurize images

For mxnet-gluon: Also execute the code in mxnet-gluon/dataprep.py to put images into the MXNet binary format RecordIO.

For any particular framework, run the code in the featurize.py file, but be sure to change the number of GPUs used depending on your setup.

Train network

Execute the code in train.py to load the featurized images and train a classifier on the features created in the previous step. By default, train.py simply trains a softmax layer on top of the VGG16 classifier, which outputs 257 probabilities. Changing the architecture can help eek out performance: adding BatchNorm, training deeper layers, adding dropout, etc.

Reference

Some of the code was adapted from the following examples:

MXNet

Keras

PyTorch

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.