• Stars
    star
    586
  • Rank 76,279 (Top 2 %)
  • Language
    Jupyter Notebook
  • Created almost 8 years ago
  • Updated almost 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

PyTorch and Tensorflow functional model definitions

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')

Unfortunately, hickle py3 support is not yet ready, so the models will be resaved in torch pickle format with torch.utils.model_zoo.load_url support, e.g.:

weights = model_zoo.load_url('https://s3.amazonaws.com/modelzoo-networks/wide-resnet-50-2-export-5ae25d50.pth')

Also, make_dot was moved to a separate package: PyTorchViz

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

More Repositories

1

pytorchviz

A small package to create visualizations of PyTorch execution graphs
Jupyter Notebook
3,180
star
2

attention-transfer

Improving Convolutional Networks via Attention Transfer (ICLR 2017)
Jupyter Notebook
1,439
star
3

wide-residual-networks

3.8% and 18.3% on CIFAR-10 and CIFAR-100
Lua
1,297
star
4

diracnets

Training Very Deep Neural Networks Without Skip-Connections
Jupyter Notebook
586
star
5

loadcaffe

Load Caffe networks in Torch7
Protocol Buffer
494
star
6

cvpr15deepcompare

Code and models for "Learning to Compare Image Patches via Convolutional Neural Networks"
C++
467
star
7

pyinn

CuPy fused PyTorch neural networks ops
Python
274
star
8

cifar.torch

92.45% on CIFAR-10 in Torch
Lua
174
star
9

torch-opencv-demos

Torch7+OpenCV+ConvNets
Lua
167
star
10

binary-wide-resnet

PyTorch implementation of Wide Residual Networks with 1-bit weights by McDonnell (ICLR 2018)
Python
124
star
11

imagine-nn

IMAGINE torch neural network routines
Lua
109
star
12

torch-caffe-binding

Use Caffe in Torch7
C++
64
star
13

imagenet-validation.torch

Fast and easy testing of imagenet models
Lua
49
star
14

neural-style-autograd

autograd version of https://github.com/jcjohnson/neural-style
Lua
44
star
15

cunnproduction

easy embeddable Torch7 networks
C++
35
star
16

nnpack.torch

Torch FFI-bindings for NNPACK
Lua
30
star
17

iterm.torch

Display images directly in iTerm2
Lua
28
star
18

openai-gemm.pytorch

PyTorch bindings for openai-gemm
Python
20
star
19

fastrcnn-models.torch

Fast-RCNN models in Torch-7 format
18
star
20

cutorch-rtc

lua apply function for cutorch
Lua
17
star
21

idiap-tutorials

Jupyter Notebook
16
star
22

functional-style-transfer

minimal implementation of style transfer
Jupyter Notebook
10
star
23

nvrtc.torch

Torch7 bindings for CUDA NVRTC (runtime compilation) library
Lua
9
star
24

imi-demos

live convolutional neural networks demos
Python
9
star
25

cunn-rtc

Runtime compiled Torch cunn modules
Lua
8
star
26

clipp.torch

Torch interface to OpenCLIPP
C++
6
star
27

examples

Python
5
star
28

libclsvm

OpenCL optimized SVM library
C++
2
star
29

infimnist.torch

Torch7 InfiMNIST ffi binding
C
1
star