Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
683cbc1
implemented padding aware im2col and col2im functions
mavenlin Feb 12, 2014
60bb4d4
add test code to test the padding aware im2col col2im functions
mavenlin Feb 14, 2014
6cd2cd2
add code to measure timing
mavenlin Feb 18, 2014
4b273e3
remove the pad=0 case in conv_layer and im2col_layer
mavenlin Feb 25, 2014
2848aa1
remove padding layers in imagenet definitions
mavenlin Feb 25, 2014
ab1e05f
unified to padding aware version
mavenlin Feb 25, 2014
8706646
remove padding_layer and its test
mavenlin Feb 25, 2014
68627ae
remove cuda_timer as is no longer needed
mavenlin Feb 25, 2014
800ba3e
Merge pull request #128 from mavenlin/pad-im2col
shelhamer Feb 25, 2014
4eca4d4
Adding GPU coverage to the DataLayer test.
sergeyk Feb 23, 2014
92302c9
HDF5DataLayer, with test.
sergeyk Feb 23, 2014
420c928
minor comment edit
sergeyk Feb 25, 2014
f3edc7c
name blobs and params for their layers in python wrapper
shelhamer Feb 15, 2014
9373986
Merge pull request #147 from sergeyk/hdf5_data
sergeyk Feb 25, 2014
ba95a87
add cpplint.py and "make lint" to run on all c source files
jeffdonahue Feb 25, 2014
8699d12
Reverse the order of hdf5_hl hdf5 as LIBRARIES in Makefile
kloudkl Feb 26, 2014
dd7854c
suppress linter errors due to not including the directory when naming .h
jeffdonahue Feb 25, 2014
4b8fe9b
fix matcaffe and pycaffe linter errors
jeffdonahue Feb 25, 2014
466ec38
add hpp to valid cpplint extensions
jeffdonahue Feb 25, 2014
488a4bd
exclude proto generated files from lint
jeffdonahue Feb 25, 2014
b065ae2
add NOLINT_NEXTLINE to suppress linter errors on nextline
jeffdonahue Feb 25, 2014
22fa0a2
fix most linter errors
jeffdonahue Feb 25, 2014
e4ff9d0
make test_gradient_check_util methods use pointers for non-const inputs
jeffdonahue Feb 25, 2014
e811565
allow TODO without username
jeffdonahue Feb 26, 2014
5b21f0d
handle linter stream errors
jeffdonahue Feb 26, 2014
5abaf5e
long -> int64_t; all linter errors fixed. woohoo!
jeffdonahue Feb 26, 2014
c66937c
fix post-rebase linter errors
jeffdonahue Feb 26, 2014
598edbf
fix compiler warning for test_hdf5data_layer
jeffdonahue Feb 26, 2014
a51e35b
add examples, python, matlab to NONGEN_CXX_SRCS so they are linted as
jeffdonahue Feb 26, 2014
8c58e41
fix linter errors in examples
jeffdonahue Feb 26, 2014
41246fc
add new tools dir to linted dir list
jeffdonahue Feb 26, 2014
218ca15
cpplint.py -> cpp_lint.py and NOLINT_NEXTLINE -> NOLINT_NEXT_LINE
jeffdonahue Feb 26, 2014
1f1d82b
Merge pull request #163 from jeffdonahue/linter
shelhamer Feb 26, 2014
5fdf55c
make lint will not rerun if successful and no source files have been
jeffdonahue Feb 26, 2014
52a539d
fix python/matlab wrapper bugs introduced by lint; change linter->lint
jeffdonahue Feb 26, 2014
de4f7a4
Merge pull request #168 from jeffdonahue/fix-lint-bugs
shelhamer Feb 27, 2014
b17ac66
Splitting source files between CUDA and CPU code.
erictzeng Feb 27, 2014
40a1548
Merge pull request #172 from erictzeng/split_cuda
shelhamer Feb 27, 2014
5fe44c8
fix 'make lint' in OSX:
jeffdonahue Feb 27, 2014
6d8acab
Merge pull request #176 from jeffdonahue/osx-make-lint-fix
shelhamer Feb 27, 2014
fffae6c
fix include order for pycaffe on osx, override lint
shelhamer Feb 27, 2014
2b125e3
Code for concat_layer for concat along num and channels dimensions
sguada Feb 17, 2014
ff2ac0b
Added concat_dim to caffe.proto and ConcatLayer to set of layers
sguada Feb 18, 2014
88bc0c1
Added Tests for Concat Layer, and passed
sguada Feb 18, 2014
eb56c5b
Fixed test to pass and don't exhaustive search since it takes too long
sguada Feb 27, 2014
93afc15
Splited concat_layer into .cpp and .cu, cleaned lint errors
sguada Feb 28, 2014
d31a36d
use absolute path in script
chyojn Feb 28, 2014
82faa9a
Merge pull request #125 from sguada/concat_layer
jeffdonahue Feb 28, 2014
b84e0f3
Merge pull request #181 from chyojn/absolute_path_of_script
shelhamer Feb 28, 2014
32fb333
Back-merge documentation updates from master
shelhamer Feb 28, 2014
77fae0c
add cifar10 80sec and 18pct models, according to convnet
chyojn Feb 28, 2014
f4d65f4
move model's pad layer into conv layer; add script to create db and t…
chyojn Mar 1, 2014
6b21067
remove specific device id from solver proto
chyojn Mar 1, 2014
8e580fd
Synchronize GPU before CPU timers start and stop in net_speed_benchmark
kloudkl Feb 20, 2014
263ceea
Add Timer to wrap CPU clock_t and GPU cudaEvent_t based timing
kloudkl Feb 20, 2014
cd84539
Replace CPU timer with newly added Timer to benchmark net speed
kloudkl Feb 20, 2014
342a911
Add state machine, boost::posix_time based cpu timer & tests for Timer
kloudkl Feb 25, 2014
cc509a9
Fix the cpplint errors for benchmark Timer
kloudkl Feb 26, 2014
5b82ac7
Log memory usage while loading a Net
sguada Mar 6, 2014
081d889
Changed display top shape to include num and count, Memory required b…
sguada Mar 6, 2014
53db54a
compute data mean for float_data
mavenlin Feb 20, 2014
a2c2f3c
move if outside of forloop
mavenlin Feb 21, 2014
9caae60
Merge pull request #134 from mavenlin/computemean
shelhamer Mar 11, 2014
9c1ceb6
pycaffe: expose ForwardPrefilled
longjon Feb 20, 2014
6228624
Merge pull request #200 from longjon/pycaffe-forwardprefilled
sergeyk Mar 13, 2014
0cb7890
Merge pull request #191 from sguada/print_memory
shelhamer Mar 13, 2014
ab3a2ac
pycaffe: blobs and params are properties, not methods
longjon Mar 1, 2014
d803535
Rename pycaffe.cpp -> _caffe.cpp in preparation for python wrapper
longjon Mar 11, 2014
6ceacd2
Add a pass-through Python wrapper of _caffe.CaffeNet
longjon Mar 11, 2014
8c46a42
Use an OrderedDict for caffe.Net.blobs
longjon Mar 11, 2014
ac1bc6f
Update detector.py to use the new Net/blobs interface
longjon Mar 11, 2014
2f12de3
Update imagenet/wrapper.py to use the new Net interface
longjon Mar 11, 2014
2690b10
Merge pull request #184 from chyojn/cifar10_model_script
shelhamer Mar 13, 2014
04d6595
Merge pull request #136 from kloudkl/cuda_timing
shelhamer Mar 13, 2014
8bc83b0
Compile a binary to run all tests at once.
erictzeng Feb 28, 2014
76e58d5
More documentation on running tests (including --gtest_filter info).
erictzeng Mar 13, 2014
0816a94
fix wrapper example paths
shelhamer Mar 14, 2014
4370b3e
add hdf5 dependency to install guide
shelhamer Mar 15, 2014
91cd44b
Expose layers and remove now-redundant params in Python interface
longjon Mar 11, 2014
8db1400
Expose caffe.Net.params as an OrderedDict
longjon Mar 11, 2014
922c4ad
Add names to the blobs returned by CaffeLayer
longjon Mar 11, 2014
ec424a5
Remove spurious constructors from CaffeBlob and CaffeBlobWrap
longjon Mar 11, 2014
9718637
Add extra comment on vector_indexing_suite to _caffe.cpp
longjon Mar 11, 2014
b9452c4
Fix indentation in C++ Python module
longjon Mar 15, 2014
585000b
support for more than 2 dimensions in hdf5 files
tdomhan Mar 16, 2014
13d156d
Merge pull request #217 from tdomhan/multidhdf5
sergeyk Mar 17, 2014
6ec66f3
DRYing and documenting HDF5 loading code.
sergeyk Mar 17, 2014
1fce1c4
HDF5DataLayer source is now a list of filenames
sergeyk Mar 17, 2014
5669f61
HDF5 data now loaded into Blobs; cleaner interface
sergeyk Mar 17, 2014
f6780f9
Fix a test assuming CPU mode without explicitly setting it.
erictzeng Mar 17, 2014
1818f81
Merge pull request #179 from erictzeng/test_all
shelhamer Mar 17, 2014
0eb1930
relax timing checks for commodity GPUs
shelhamer Mar 17, 2014
3c19256
make runtest with TEST_ALL_BIN obey TEST_GPUID
jeffdonahue Mar 17, 2014
f716084
Making HDF5 blob data non-mutable for copy (minor)
sergeyk Mar 17, 2014
7eeae76
Merge pull request #222 from jeffdonahue/test-all-bin-gpuid
shelhamer Mar 17, 2014
e6055c1
Lint errors fixed, except still using stream.
sergeyk Mar 17, 2014
114773f
minor
sergeyk Mar 17, 2014
51d27d1
Move semicolon to appease lint
longjon Mar 17, 2014
f890a18
Merge pull request #199 from longjon/pycaffe-ordereddict
shelhamer Mar 18, 2014
33acedb
Merge pull request #203 from sergeyk/hdf5_data
sguada Mar 18, 2014
7dd03b3
bring back padding layer with deprecation notice
shelhamer Mar 18, 2014
73db43c
bring back padding test and lint it
shelhamer Mar 18, 2014
76c077b
style: line continuation spacing
shelhamer Mar 18, 2014
708181a
Add ImageNet Lena filter visualization example
longjon Mar 18, 2014
9de4682
Add the feature and filter visualization example (Lena) to docs
longjon Mar 18, 2014
8a595a9
Merge pull request #227 from shelhamer/padding-deprecation
longjon Mar 18, 2014
82c38b2
Add comment explaining placement of system headers in C++ Python module
longjon Mar 18, 2014
895cd77
Raise Python exceptions if CaffeNet input files don't exist
longjon Mar 12, 2014
7936385
Merge pull request #228 from longjon/pycaffe-exceptions
shelhamer Mar 18, 2014
da3c997
Draft CIFAR-10 doc and cleanup example
shelhamer Mar 18, 2014
974215d
Merge pull request #226 from longjon/imagenet-vis
shelhamer Mar 18, 2014
1147318
Back-merge documentation and historical PRs to master
shelhamer Mar 18, 2014
3537728
fix style bugs in new layers' proto fields
shelhamer Mar 18, 2014
ce7b375
sort layer factory's list alphabetically
shelhamer Mar 18, 2014
ffcdb03
link draft CIFAR-10 example
shelhamer Mar 18, 2014
e0e4110
minor mnist example update
shelhamer Mar 18, 2014
53f1ef3
Display total num of processed files after computing image mean
kloudkl Mar 17, 2014
9b9eb7a
Avoid repeatedly downloading caffe reference imagenet model
kloudkl Mar 17, 2014
41a126d
Add support for md5 checksum on OS X
kloudkl Mar 18, 2014
7ccaae0
Merge pull request #229 from kloudkl/minor_change
shelhamer Mar 18, 2014
20f3dc7
Merge pull request #230 from kloudkl/get_model_script
sergeyk Mar 18, 2014
bc37a0f
minor fix to caffe model DL script
sergeyk Mar 18, 2014
34e04cf
removing notebooks in docs, updating instructions
sergeyk Mar 18, 2014
b77e5d4
minor fixes suggested by evan
sergeyk Mar 18, 2014
8ee753d
Merge pull request #234 from sergeyk/updating_docs
shelhamer Mar 18, 2014
8ee1142
groom docs, move Caffe presentation to dropbox
shelhamer Mar 18, 2014
0c6d063
build_docs script
sergeyk Mar 18, 2014
c5ab837
fix README links to presentation and development section
shelhamer Mar 18, 2014
d124b8f
drop models/ in favor of examples/
shelhamer Mar 18, 2014
8ce9236
lint, except for rand/rand_r
shelhamer Mar 18, 2014
6372622
addd CUDA_KERNEL_LOOP macro
blackball Mar 18, 2014
9049c8f
fix kernel loop bugs, compiles and passes all tests
jeffdonahue Mar 19, 2014
dafbba7
Merge pull request #239 from jeffdonahue/fix-kernel-loop-macro
jeffdonahue Mar 19, 2014
5f4e38f
fix remaining issues related to CUDA_KERNEL_LOOP
jeffdonahue Mar 19, 2014
7666873
fix remaining lint errors
jeffdonahue Mar 19, 2014
77e07b5
use CUDA_KERNEL_LOOP in padding layer
jeffdonahue Mar 19, 2014
26e53d8
Merge pull request #240 from jeffdonahue/rm-cuda-kernel-loop-comments
jeffdonahue Mar 19, 2014
6088395
add libcaffe.a to TEST_ALL_BIN dependencies in Makefile
jeffdonahue Mar 18, 2014
9251ae7
also fix for runtest
jeffdonahue Mar 18, 2014
c193976
Merge pull request #236 from jeffdonahue/test-all-bin-makefile-deps
jeffdonahue Mar 19, 2014
faccb9a
arrange example images, update paths, bring back imagenet_pretrained
shelhamer Mar 19, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,5 @@ data/*
examples/*

# Don't version the generated documentation
docs/_site
docs/_site
_site
53 changes: 44 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ HXX_SRCS := $(shell find include/$(PROJECT) ! -name "*.hpp")
# CU_SRCS are the cuda source files
CU_SRCS := $(shell find src/$(PROJECT) -name "*.cu")
# TEST_SRCS are the test source files
TEST_MAIN_SRC := src/$(PROJECT)/test/test_caffe_main.cpp
TEST_SRCS := $(shell find src/$(PROJECT) -name "test_*.cpp")
TEST_SRCS := $(filter-out $(TEST_MAIN_SRC), $(TEST_SRCS))
GTEST_SRC := src/gtest/gtest-all.cpp
# TEST_HDRS are the test header files
TEST_HDRS := $(shell find src/$(PROJECT) -name "test_*.hpp")
Expand All @@ -32,9 +34,21 @@ TOOL_SRCS := $(shell find tools -name "*.cpp")
EXAMPLE_SRCS := $(shell find examples -name "*.cpp")
# PROTO_SRCS are the protocol buffer definitions
PROTO_SRCS := $(wildcard src/$(PROJECT)/proto/*.proto)
# NONGEN_CXX_SRCS includes all source/header files except those generated
# automatically (e.g., by proto).
NONGEN_CXX_SRCS := $(shell find \
src/$(PROJECT) \
include/$(PROJECT) \
python/$(PROJECT) \
matlab/$(PROJECT) \
examples \
tools \
-name "*.cpp" -or -name "*.hpp" -or -name "*.cu" -or -name "*.cuh")
LINT_REPORT := $(BUILD_DIR)/cpp_lint.log
FAILED_LINT_REPORT := $(BUILD_DIR)/cpp_lint.error_log
# PY$(PROJECT)_SRC is the python wrapper for $(PROJECT)
PY$(PROJECT)_SRC := python/$(PROJECT)/py$(PROJECT).cpp
PY$(PROJECT)_SO := python/$(PROJECT)/py$(PROJECT).so
PY$(PROJECT)_SRC := python/$(PROJECT)/_$(PROJECT).cpp
PY$(PROJECT)_SO := python/$(PROJECT)/_$(PROJECT).so
# MAT$(PROJECT)_SRC is the matlab wrapper for $(PROJECT)
MAT$(PROJECT)_SRC := matlab/$(PROJECT)/mat$(PROJECT).cpp
MAT$(PROJECT)_SO := matlab/$(PROJECT)/$(PROJECT)
Expand Down Expand Up @@ -62,6 +76,7 @@ GTEST_OBJ := $(addprefix $(BUILD_DIR)/, ${GTEST_SRC:.cpp=.o})
TOOL_BINS := ${TOOL_OBJS:.o=.bin}
EXAMPLE_BINS := ${EXAMPLE_OBJS:.o=.bin}
TEST_BINS := ${TEST_OBJS:.o=.testbin}
TEST_ALL_BIN := $(BUILD_DIR)/src/$(PROJECT)/test/test_all.testbin

##############################
# Derive include and lib directories
Expand All @@ -73,8 +88,13 @@ MKL_LIB_DIR := $(MKL_DIR)/lib $(MKL_DIR)/lib/intel64

INCLUDE_DIRS += ./src ./include $(CUDA_INCLUDE_DIR) $(MKL_INCLUDE_DIR)
LIBRARY_DIRS += $(CUDA_LIB_DIR) $(MKL_LIB_DIR)
LIBRARIES := cudart cublas curand mkl_rt pthread \
glog protobuf leveldb snappy boost_system \
LIBRARIES := cudart cublas curand \
mkl_rt \
pthread \
glog protobuf leveldb \
snappy \
boost_system \
hdf5_hl hdf5 \
opencv_core opencv_highgui opencv_imgproc
PYTHON_LIBRARIES := boost_python python2.7
WARNINGS := -Wall
Expand All @@ -90,7 +110,8 @@ PYTHON_LDFLAGS := $(LDFLAGS) $(foreach library,$(PYTHON_LIBRARIES),-l$(library))
##############################
# Define build targets
##############################
.PHONY: all init test clean linecount tools examples py mat distribute py$(PROJECT) mat$(PROJECT) proto
.PHONY: all init test clean linecount lint tools examples py mat distribute \
py$(PROJECT) mat$(PROJECT) proto runtest

all: init $(NAME) $(STATIC_NAME) tools examples
@echo $(CXX_OBJS)
Expand All @@ -105,7 +126,18 @@ init:
linecount: clean
cloc --read-lang-def=$(PROJECT).cloc src/$(PROJECT)/

test: init $(TEST_BINS)
lint: $(LINT_REPORT)

$(LINT_REPORT): $(NONGEN_CXX_SRCS)
@ mkdir -p $(BUILD_DIR)
@ (python ./scripts/cpp_lint.py $(NONGEN_CXX_SRCS) > $(LINT_REPORT) 2>&1 \
&& (rm -f $(FAILED_LINT_REPORT); echo "No lint errors!")) || ( \
mv $(LINT_REPORT) $(FAILED_LINT_REPORT); \
grep -v "^Done processing " $(FAILED_LINT_REPORT); \
echo "Found 1 or more lint errors; see log at $(FAILED_LINT_REPORT)"; \
exit 1)

test: init $(TEST_BINS) $(TEST_ALL_BIN)

tools: init $(TOOL_BINS)

Expand Down Expand Up @@ -135,11 +167,14 @@ $(STATIC_NAME): init $(PROTO_OBJS) $(OBJS)
ar rcs $(STATIC_NAME) $(PROTO_OBJS) $(OBJS)
@echo

runtest: test
for testbin in $(TEST_BINS); do $$testbin $(TEST_GPUID); done
runtest: $(TEST_ALL_BIN)
$(TEST_ALL_BIN) $(TEST_GPUID)

$(TEST_BINS): %.testbin : %.o $(GTEST_OBJ) $(STATIC_NAME) $(TEST_HDRS)
$(CXX) $< $(GTEST_OBJ) $(STATIC_NAME) -o $@ $(CXXFLAGS) $(LDFLAGS) $(WARNINGS)
$(CXX) $(TEST_MAIN_SRC) $< $(GTEST_OBJ) $(STATIC_NAME) -o $@ $(CXXFLAGS) $(LDFLAGS) $(WARNINGS)

$(TEST_ALL_BIN): $(GTEST_OBJ) $(STATIC_NAME) $(TEST_OBJS)
$(CXX) $(TEST_MAIN_SRC) $(TEST_OBJS) $(GTEST_OBJ) $(STATIC_NAME) -o $(TEST_ALL_BIN) $(CXXFLAGS) $(LDFLAGS) $(WARNINGS)

$(TOOL_BINS): %.bin : %.o $(STATIC_NAME)
$(CXX) $< $(STATIC_NAME) -o $@ $(CXXFLAGS) $(LDFLAGS) $(WARNINGS)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ line of code: `Caffe::set_mode(Caffe::CPU)`.
Even in CPU mode, computing predictions on an image takes only 20 ms when images
are processed in batch mode.

* [Caffe introductory presentation](https://www.dropbox.com/s/10fx16yp5etb8dv/caffe-presentation.pdf)
* [Installation instructions](http://caffe.berkeleyvision.org/installation.html)
* [Caffe presentation](https://docs.google.com/presentation/d/1lzyXMRQFlOYE2Jy0lCNaqltpcCIKuRzKJxQ7vCuPRc8/edit?usp=sharing) at the Berkeley Vision Group meeting

\* When measured with the [SuperVision](http://www.image-net.org/challenges/LSVRC/2012/supervision.pdf) model that won the ImageNet Large Scale Visual Recognition Challenge 2012.

Expand Down
95 changes: 95 additions & 0 deletions docs/cifar10.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
---
layout: default
title: Caffe
---

Alex's CIFAR-10 tutorial, Caffe style
=====================================

Alex Krizhevsky's [cuda-convnet](https://code.google.com/p/cuda-convnet/) details the model definitions, parameters, and training procedure for good performance on CIFAR-10. This example reproduces his results in Caffe.

We will assume that you have Caffe successfully compiled. If not, please refer to the [Installation page](installation.html). In this tutorial, we will assume that your caffe installation is located at `CAFFE_ROOT`.

We thank @chyojn for the pull request that defined the model schemas and solver configurations.

*This example is a work-in-progress. It would be nice to further explain details of the network and training choices and benchmark the full training.*

Prepare the Dataset
-------------------

You will first need to download and convert the data format from the [CIFAR-10 website](http://www.cs.toronto.edu/~kriz/cifar.html). To do this, simply run the following commands:

cd $CAFFE_ROOT/data/cifar10
./get_cifar10.sh
cd $CAFFE_ROOT/examples/cifar10
./create_cifar10.sh

If it complains that `wget` or `gunzip` are not installed, you need to install them respectively. After running the script there should be the dataset, `./cifar10-leveldb`, and the data set image mean `./mean.binaryproto`.

The Model
---------

The CIFAR-10 model is a CNN that composes layers of convolution, pooling, rectified linear unit (ReLU) nonlinearities, and local contrast normalization with a linear classifier on top of it all. We have defined the model in the `CAFFE_ROOT/examples/cifar10` directory's `cifar10_quick_train.prototxt`.

Training and Testing the "Quick" Model
--------------------------------------

Training the model is simple after you have written the network definition protobuf and solver protobuf files. Simply run `train_quick.sh`, or the following command directly:

cd $CAFFE_ROOT/examples/cifar10
./train_quick.sh

`train_quick.sh` is a simple script, so have a look inside. `GLOG_logtostderr=1` is the google logging flag that prints all the logging messages directly to stderr. The main tool for training is `train_net.bin`, with the solver protobuf text file as its argument.

When you run the code, you will see a lot of messages flying by like this:

I0317 21:52:48.945710 2008298256 net.cpp:74] Creating Layer conv1
I0317 21:52:48.945716 2008298256 net.cpp:84] conv1 <- data
I0317 21:52:48.945725 2008298256 net.cpp:110] conv1 -> conv1
I0317 21:52:49.298691 2008298256 net.cpp:125] Top shape: 100 32 32 32 (3276800)
I0317 21:52:49.298719 2008298256 net.cpp:151] conv1 needs backward computation.

These messages tell you the details about each layer, its connections and its output shape, which may be helpful in debugging. After the initialization, the training will start:

I0317 21:52:49.309370 2008298256 net.cpp:166] Network initialization done.
I0317 21:52:49.309376 2008298256 net.cpp:167] Memory required for Data 23790808
I0317 21:52:49.309422 2008298256 solver.cpp:36] Solver scaffolding done.
I0317 21:52:49.309447 2008298256 solver.cpp:47] Solving CIFAR10_quick_train

Based on the solver setting, we will print the training loss function every 100 iterations, and test the network every 500 iterations. You will see messages like this:

I0317 21:53:12.179772 2008298256 solver.cpp:208] Iteration 100, lr = 0.001
I0317 21:53:12.185698 2008298256 solver.cpp:65] Iteration 100, loss = 1.73643
...
I0317 21:54:41.150030 2008298256 solver.cpp:87] Iteration 500, Testing net
I0317 21:54:47.129461 2008298256 solver.cpp:114] Test score #0: 0.5504
I0317 21:54:47.129500 2008298256 solver.cpp:114] Test score #1: 1.27805

For each training iteration, `lr` is the learning rate of that iteration, and `loss` is the training function. For the output of the testing phase, **score 0 is the accuracy**, and **score 1 is the testing loss function**.

And after making yourself a cup of coffee, you are done!

I0317 22:12:19.666914 2008298256 solver.cpp:87] Iteration 5000, Testing net
I0317 22:12:25.580330 2008298256 solver.cpp:114] Test score #0: 0.7533
I0317 22:12:25.580379 2008298256 solver.cpp:114] Test score #1: 0.739837
I0317 22:12:25.587262 2008298256 solver.cpp:130] Snapshotting to cifar10_quick_iter_5000
I0317 22:12:25.590215 2008298256 solver.cpp:137] Snapshotting solver state to cifar10_quick_iter_5000.solverstate
I0317 22:12:25.592813 2008298256 solver.cpp:81] Optimization Done.

Our model achieved ~75% test accuracy. The model parameters are stored in binary protobuf format in

cifar10_quick_iter_5000

which is ready-to-deploy in CPU or GPU mode! Refer to the `CAFFE_ROOT/examples/cifar10/cifar10_quick.prototxt` for the deployment model definition that can be called on new data.

Why train on a GPU?
-------------------

CIFAR-10, while still small, has enough data to make GPU training attractive.

To compare CPU vs. GPU training speed, simply change one line in all the `cifar*solver.prototxt`:

# solver mode: 0 for CPU and 1 for GPU
solver_mode: 0

and you will be using CPU for training.
14 changes: 13 additions & 1 deletion docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Developing & Contributing
Caffe is developed with active participation of the community by the [Berkeley Vision and Learning Center](http://bvlc.eecs.berkeley.edu/).
We welcome all contributions!

The [contributing workflow](https://github.com/BVLC/caffe#contributing) is explained in the README. These guidelines cover development practices in Caffe. This is a work-in-progress.
The [contributing workflow](https://github.com/BVLC/caffe#development) is explained in the README. These guidelines cover development practices in Caffe. This is a work-in-progress.

**Development Flow**

Expand All @@ -36,6 +36,18 @@ We'd appreciate your contribution to the documentation effort!

**Testing**: run `make runtest` to check the project tests. New code requires new tests. Pull requests that fail tests will not be accepted.

The `googletest` framework we use provides many additional options, which you can access by running the test binaries directly. One of the more useful options is `--gtest_filter`, which allows you to filter tests by name:

# run all tests with CPU in the name
build/src/caffe/test/test_all.testbin --gtest_filter='*CPU*'

# run all tests without GPU in the name (note the leading minus sign)
build/src/caffe/test/test_all.testbin --gtest_filter=-'*GPU*'

To get a list of all options `googletest` provides, simply pass the `--help` flag:

build/src/caffe/test/test_all.testbin --help

**Style**

- Follow [Google C++ style](http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml) and [Google python style](http://google-styleguide.googlecode.com/svn/trunk/pyguide.html) + [PEP 8](http://legacy.python.org/dev/peps/pep-0008/).
Expand Down
17 changes: 17 additions & 0 deletions docs/getting_pretrained_models.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
layout: default
---

# Pre-trained models

[BVLC](http://bvlc.eecs.berkeley.edu) aims to provide a variety of high quality pre-trained models.
Note that unlike Caffe itself, these models are licensed for **academic research / non-commercial use only**.
If you have any questions, please get in touch with us.

This page will be updated as more models become available.

### ImageNet

Our reference implementation of the AlexNet model trained on ILSVRC-2012 can be downloaded (232.57MB) by running `examples/imagenet/get_caffe_reference_imagenet_model.sh` from the Caffe root directory.

Additionally, you will probably eventually need some auxiliary data (mean image, synset list, etc.): run `data/ilsvrc12/get_ilsvrc_aux.sh` from the root directory to obtain it.
Loading