Skip to content

Instantly share code, notes, and snippets.

from neon.initializers import Constant, Gaussian, Uniform, Xavier
from neon.layers import Affine, BranchNode, Conv, Dropout, LRN, MergeBroadcast, Pooling, SingleOutputTree
from neon.transforms import Rectlin, Softmax
from neon.optimizers import GradientDescentMomentum, MultiOptimizer, Schedule
from neon.transforms import CrossEntropyMulti, TopKMisclassification, Misclassification
from neon.layers import GeneralizedCost
from neon.callbacks.callbacks import Callbacks
from neon.data import ImageLoader
from neon.models import Model
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# Copyright 2015 Nervana Systems Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# Copyright 2015 Nervana Systems Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@nervetumer
nervetumer / alexnet_inference.py
Last active May 10, 2016 15:00
example of running inference on an image using neon
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# Copyright 2015 Nervana Systems Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@nervetumer
nervetumer / cifar10_allcnn.py
Last active February 9, 2016 20:58
neon cifar10_allcnn implementation
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# Copyright 2015 Nervana Systems Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@nervetumer
nervetumer / readme.md
Last active February 9, 2016 01:02
neon VGG

##Model

Here we have ported the weights for the 16 and 19 layer VGG models from the Caffe model zoo (see link)

Model script

The model run script is included below (vgg_neon.py). This script can easily be adapted for fine tuning this network but we have focused on inference here because a successful training protocol may require details beyond what is available from the Caffe model zoo.

Trained weights

The trained weights file can be downloaded from AWS using the following links: VGG_D.p and VGG_E.p.

#!/usr/bin/env python
# ----------------------------------------------------------------------------
# Copyright 2015 Nervana Systems Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@nervetumer
nervetumer / googlenet_neon.py
Last active February 9, 2016 20:28
Implementation of googlenet on neon
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# Copyright 2015 Nervana Systems Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# Copyright 2015 Nervana Systems Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software