GithubHelp home page GithubHelp logo

sebastinsanty / functional-zoo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from szagoruyko/functional-zoo

0.0 2.0 1.0 827 KB

PyTorch and Tensorflow functional model definitions

CMake 0.02% C++ 0.10% Jupyter Notebook 99.50% Python 0.38%

functional-zoo's Introduction

functional-zoo

Model definitions and pretrained weights for PyTorch and Tensorflow

PyTorch, unlike lua torch, has autograd in it's core, so using modular structure of torch.nn modules is not necessary, one can easily allocate needed Variables and write a function that utilizes them, which is sometimes more convenient. This repo contains model definitions in this functional way, with pretrained weights for some models.

Weights are serialized as a dict of arrays in hdf5, so should be easily loadable in other frameworks. Thanks to @edgarriba we have cpp_parser for loading weights in C++.

More models coming! We also plan to add definitions for other frameworks in future, probably tiny-dnn first. Contributions are welcome.

See also imagenet classification with PyTorch demo.ipynb

Models

All models were validated to produce reported accuracy using imagenet-validation.py script (depends on OpenCV python bindings).

To load weights in Python first do pip install hickle, then:

import hickle as hkl
weights = hkl.load('resnet-18-export.hkl')

And the weights will be a dict of numpy arrays. See the notebooks for more examples.

Folded

Models below have batch_norm parameters and statistics folded into convolutional layers for speed. It is not recommended to use them for finetuning.

ImageNet

model notebook val error download size
VGG-16 vgg-16.ipynb 30.09, 10.69 url coming 528 MB
NIN nin-export.ipynb 32.96, 12.29 url 33 MB
ResNet-18 (fb) resnet-18-export.ipynb 30.43, 10.76 url 42 MB
ResNet-18-AT resnet-18-at-export.ipynb 29.44, 10.12 url 44.1 MB
ResNet-34 (fb) resnet-34-export.ipynb 26.72, 8.74 url 78.3 MB
WRN-50-2 wide-resnet-50-2-export.ipynb 22.0, 6.05 url 246 MB

Fast Neural Style

Notebook: fast-neural-style.ipynb

Models:

model download size
candy.hkl url 7.1 MB
feathers.hkl url 7.1 MB
wave.hkl url 7.1 MB

Models with batch normalization

Coming

functional-zoo's People

Contributors

dasguptar avatar edgarriba avatar szagoruyko avatar

Watchers

 avatar  avatar

Forkers

qbss

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.