Skip to content

Commit

Permalink
Merge master into coverity_scan to invoke scan-build
Browse files Browse the repository at this point in the history
# Conflicts:
#	.travis.yml
  • Loading branch information
nyanp committed May 8, 2017
2 parents e57144e + ca9ad1d commit 3aafb37
Show file tree
Hide file tree
Showing 126 changed files with 9,815 additions and 3,652 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Expand Up @@ -61,6 +61,8 @@ branches:
- master
- coverity_scan
- feat/tensor_integration
- feat/decouple_activations

env:
global:
- USE_TBB=ON
Expand Down
2 changes: 1 addition & 1 deletion .travis/clang-format.sh
Expand Up @@ -30,4 +30,4 @@ else
echo -e "$RED Failed matching files with clang-format.$COLOR_OFF" >&2
fi

exit $RE
exit $RE
2 changes: 2 additions & 0 deletions CMakeLists.txt
Expand Up @@ -206,6 +206,8 @@ set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
message(STATUS "C++11 support has been enabled by default.")

include(cotire)

# Unix
if(CMAKE_COMPILER_IS_GNUCXX OR MINGW OR
CMAKE_CXX_COMPILER_ID MATCHES "Clang")
Expand Down
16 changes: 9 additions & 7 deletions Dockerfile
@@ -1,4 +1,4 @@
FROM ubuntu:16.04
FROM ubuntu:17.04

MAINTAINER Edgar Riba <edgar.riba@gmail.com>

Expand All @@ -20,20 +20,22 @@ RUN apt-get install -y \
libpthread-stubs0-dev \
libtbb-dev

# Upgrade pip
RUN pip install --upgrade pip

# Download and configure PeachPy
RUN cd /software && \
git clone https://github.com/Maratyszcza/PeachPy.git && \
cd /software/PeachPy && \
pip install -r requirements.txt && \
python setup.py generate && \
pip install .
RUN pip install --upgrade git+https://github.com/Maratyszcza/PeachPy

# Download and configure confu
RUN pip install --upgrade git+https://github.com/Maratyszcza/confu

# Download and configure NNPACK
RUN apt-get install ninja-build && \
pip install ninja-syntax && \
cd /software && \
git clone --recursive https://github.com/Maratyszcza/NNPACK.git && \
cd /software/NNPACK && \
confu setup && \
python ./configure.py && \
ninja

Expand Down
17 changes: 8 additions & 9 deletions README.md
Expand Up @@ -98,7 +98,7 @@ Please see [wiki page](https://github.com/tiny-dnn/tiny-dnn/wiki/Comparison-with
Nothing. All you need is a C++11 compiler.

## Build
tiny-dnn is header-ony, so *there's nothing to build*. If you want to execute sample program or unit tests, you need to install [cmake](https://cmake.org/) and type the following commands:
tiny-dnn is header-only, so *there's nothing to build*. If you want to execute sample program or unit tests, you need to install [cmake](https://cmake.org/) and type the following commands:

```
cmake .
Expand Down Expand Up @@ -151,10 +151,10 @@ void construct_cnn() {
network<sequential> net;

// add layers
net << conv<tan_h>(32, 32, 5, 1, 6) // in:32x32x1, 5x5conv, 6fmaps
<< ave_pool<tan_h>(28, 28, 6, 2) // in:28x28x6, 2x2pooling
<< fc<tan_h>(14 * 14 * 6, 120) // in:14x14x6, out:120
<< fc<identity>(120, 10); // in:120, out:10
net << conv(32, 32, 5, 1, 6) << tanh() // in:32x32x1, 5x5conv, 6fmaps
<< ave_pool(28, 28, 6, 2) << tanh() // in:28x28x6, 2x2pooling
<< fc(14 * 14 * 6, 120) << tanh() // in:14x14x6, out:120
<< fc(120, 10); // in:120, out:10

assert(net.in_data_size() == 32 * 32);
assert(net.out_data_size() == 10);
Expand All @@ -170,7 +170,7 @@ void construct_cnn() {
adagrad optimizer;

// train (50-epoch, 30-minibatch)
net.train<mse>(optimizer, train_images, train_labels, 30, 50);
net.train<mse, adagrad>(optimizer, train_images, train_labels, 30, 50);

// save
net.save("net");
Expand All @@ -191,8 +191,7 @@ using namespace tiny_dnn::layers;
void construct_mlp() {
network<sequential> net;
net << fc<sigmoid>(32 * 32, 300)
<< fc<identity>(300, 10);
net << fc(32 * 32, 300) << sigmoid() << fc(300, 10);
assert(net.in_data_size() == 32 * 32);
assert(net.out_data_size() == 10);
Expand All @@ -207,7 +206,7 @@ using namespace tiny_dnn;
using namespace tiny_dnn::activation;

void construct_mlp() {
auto mynet = make_mlp<tan_h>({ 32 * 32, 300, 10 });
auto mynet = make_mlp<tanh>({ 32 * 32, 300, 10 });

assert(mynet.in_data_size() == 32 * 32);
assert(mynet.out_data_size() == 10);
Expand Down

0 comments on commit 3aafb37

Please sign in to comment.