Skip to content

DavyVan/MiniCaffe

Repository files navigation

UCR-CS217-FinalProject

master: Build Status fq-dev: Build Status yz-branch: Build Status mc-dev: Build Status

NOTICE

  1. Add wrapper for each layer. For example: FullyConnectedLayer has a wrapper FullyConnectedLayer FullyConnectedLayer::fc(Net* net, name, lefts, right[, layer specific params]). You should call Layer::add_to_net() in the wrapper, so you need some extra arguments. Please refer to layer.h. Then, you should check the return value of Layer::add_to_net() to make sure everything was ok, if any error occurred the program may abort (use exit(errno)).
  2. Layer Class: Call base class Layer's constructor function with layer's name
  3. Must provide get_outputs_dimensions(). Each blob has 4 dimensions [batchsize, x, y, z]. If exist more than one blobs, concatenate them in one integer array.
  4. Error Handling: If you need to tell caller that something went wrong, you can return a error code. You can define your own error code in errors.h (pick next available number) and add its human readable error message in errors.cpp.
  5. Encounter some open problems? You can label things to be done by adding a comment begin with //TODO: (case sensitive) so that all unsolved problem can be tracked by some IDEs.
  6. Do no need to modify CMakeLists.txt to track new files. I have already modified it to enable cmake to automatically search all *.cpp files and include them for compiling.

3/8/2019:

  1. Maintain private(or public) members for layer specific parameters, including the W and delta_W, by yourself. W should be updated by delta_W at each batch.
  2. Do not compile main.cpp for debuging. It is not UNIT test but a system test.
  3. If you would access private members in test, please refer reqnet.h and reqnet_test.cpp.
  4. How to compute: As shown in layer.h, necessary data are already stored in the base class. So no more arguments for infer() and bp(). infer() now is infer(vector<Blob*> lefts, vector<Blob*> rights) so that you can retrieve data from arguments directly. Same change to bp().

Limitations

  1. Simplified network construction: A blob can only be modified AND used by one layer. Only input layer and loss layer (the final one) can have multiple outputs/inputs and the order of blobs must be pre-defined manually. (e.g. input layer produces two blobs "data" and "label", not "label" and "data").
  2. No check for repeated names of blobs and layers.
  3. Cannot control the start point and end point. You can only run the whole net forward or/and backward.
  4. For other unstated limitations, please see the TODOs in source code.

Requirements

  • g++ 4.9+
  • CMake 2.8.11+
  • CUDA

How to build MiniCaffe

git clone [url]  
cd [root_dir]  
git submodule init  
git submodule update
cd minicaffe/build  
cmake ..            # Without test
cmake --build .     # Then find target library in minicaffe/build/ 

How to build with test

git clone [url]
cd [root_dir]
git submodule init
git submodule update
cd minicaffe/build
cmake .. -DTEST_ENABLED=ON      # This option will enable GoogleTest and our test case
cmake --build .                 # Then find target library in minicaffe/build/ 
                                  and xxx_test in minicaffe/build/test

How to build main.cpp

git clone [url]
cd [root_dir]
git submodule init
git submodule update
cd build
cmake ..
cmake --build .     # Then find the final executable in [root dir]/build/

How to build on Tardis

git clone [url]
cd [root_dir]
git submodule init
git submodule update
cd build
export CXX=/act/gcc-5.1.0/bin/g++
export CC=/act/gcc-5.1.0/bin/gcc
cmake -D CMAKE_C_COMPILER=gcc CMAKE_CXX_COMPILER=g++ /curr_absolute_build_path/
cmake .. -DTEST_ENABLED=ON
cmake --build .     # Then find the final executable in [root dir]/build/

How to build on Tardis

git clone [url]
cd [root_dir]
git submodule init
git submodule update
cd build
export CXX=/act/gcc-5.1.0/bin/g++
export CC=/act/gcc-5.1.0/bin/gcc
cmake -D CMAKE_C_COMPILER=gcc CMAKE_CXX_COMPILER=g++ /curr_absolute_build_path/
cmake .. -DTEST_ENABLED=ON
cmake --build .     # Then find the final executable in [root dir]/build/

Change log of master branch

3/8/2019

  • Added "yz-branch" to Travis CI
  • Modified CMakeLists to support GTest with private members.
  • Added new definition of Generator.
  • New SeqNet. Net is obsoleted. With test.
  • Updated Layer's interface (i.e. infer()).
  • Minor changes.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published