summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a7a7c34)
raw | patch | inline | side by side (parent: a7a7c34)
author | Chenchi Luo <a0282871@ti.com> | |
Tue, 26 May 2015 16:14:59 +0000 (11:14 -0500) | ||
committer | Chenchi Luo <a0282871@ti.com> | |
Tue, 26 May 2015 16:14:59 +0000 (11:14 -0500) |
build/build_version.txt | patch | blob | history | |
build/build_version.txt~ | [deleted file] | patch | blob | history |
build/makefile~ | [deleted file] | patch | blob | history |
debian/changelog | patch | blob | history | |
debian/changelog~ | [deleted file] | patch | blob | history |
src/app/cnn/class/cifar10/appCNNClassCIFAR10Testing.c | patch | blob | history | |
src/app/cnn/class/cifar10/appCNNClassCIFAR10Testing.c~ | [deleted file] | patch | blob | history |
src/app/makefile~ | [deleted file] | patch | blob | history |
src/common/cnn/timlCNNSetBatchSize.c | patch | blob | history |
index 6efe8d2a22ef3698772979420b980f59066a6fce..4362726a8cd5b2ce13780235b391ab71cc6d438a 100644 (file)
--- a/build/build_version.txt
+++ b/build/build_version.txt
-1.0.2.0
+01.00.02.03
diff --git a/build/build_version.txt~ b/build/build_version.txt~
--- a/build/build_version.txt~
+++ /dev/null
@@ -1 +0,0 @@
-1.0.1.0
diff --git a/build/makefile~ b/build/makefile~
--- a/build/makefile~
+++ /dev/null
@@ -1,97 +0,0 @@
-################################################################################\r
-#\r
-# makefile\r
-#\r
-# Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/\r
-#\r
-# Redistribution and use in source and binary forms, with or without\r
-# modification, are permitted provided that the following conditions\r
-# are met:\r
-#\r
-# Redistributions of source code must retain the above copyright\r
-# notice, this list of conditions and the following disclaimer.\r
-#\r
-# Redistributions in binary form must reproduce the above copyright\r
-# notice, this list of conditions and the following disclaimer in the\r
-# documentation and/or other materials provided with the\r
-# distribution.\r
-#\r
-# Neither the name of Texas Instruments Incorporated nor the names of\r
-# its contributors may be used to endorse or promote products derived\r
-# from this software without specific prior written permission.\r
-#\r
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
-#\r
-################################################################################\r
-\r
-#check os\r
-UNAME_M :=$(shell uname -m)\r
-\r
-BIN_DIR := ../bin\r
-BUILD_DIR := build\r
-SRC_DIR := ../src\r
-\r
-ACCLERERATOR := NONE\r
-\r
-# COMMON\r
-COMMON_LIB_SRC_DIR = $(SRC_DIR)/common\r
-COMMON_LIB_DIR = $(BIN_DIR)\r
-COMMON_LIB_NAME = timl\r
-COMMON_LIB_FULL_NAME = $(COMMON_LIB_DIR)/lib$(COMMON_LIB_NAME).a\r
-COMMON_LIB_CFILES = $(shell find $(COMMON_LIB_SRC_DIR) -name "*.c")\r
-COMMON_LIB_HFILES = $(shell find $(COMMON_LIB_SRC_DIR) -name "*.h")\r
-COMMON_LIB_OBJS = $(patsubst %.c, %.o, $(COMMON_LIB_CFILES))\r
-\r
-\r
-\r
-ifneq (,$(findstring 86, $(UNAME_M)))\r
-CC = arm-linux-gnueabihf-gcc\r
-AR = arm-linux-gnueabihf-ar\r
-else\r
-CC = gcc\r
-AR=ar\r
-endif\r
-\r
-\r
-\r
-C_INCLUDE_PATH = $(SRC_DIR)/common/api $(SRC_DIR)/common/cnn $(SRC_DIR)/common/util $(SRC_DIR)/dsp\\r
-$(TARGET_ROOT)/usr/include\r
-C_INCLUDE_FLAG = $(foreach d, $(C_INCLUDE_PATH), -I$d)\r
-CFLAGS += -g -O3 -fopenmp\r
-AR = @ar\r
-ARFLAGS = -rcs\r
-RM = @rm\r
-RMFLAGS += -fr\r
-\r
-all: $(COMMON_LIB_FULL_NAME)\r
-\r
-# common lib\r
-$(COMMON_LIB_FULL_NAME):$(COMMON_LIB_OBJS)\r
- @echo Generate static library $(COMMON_LIB_NAME) from $^\r
- $(AR) $(ARFLAGS) $(COMMON_LIB_FULL_NAME) $^\r
-\r
-# common lib objs \r
-$(COMMON_LIB_OBJS):%.o: %.c $(COMMON_LIB_HFILES)\r
- @echo Compile $<\r
- $(CC) -c $(CFLAGS) -o $@ $< $(C_INCLUDE_FLAG)\r
-\r
-clean:\r
- $(RM) $(RMFLAGS) \\r
- $(COMMON_LIB_OBJS) \\r
- $(COMMON_LIB_FULL_NAME)\r
-\r
-install:\r
- cp $(CURDIR)/../src/common/api/timl.h $(DESTDIR)/usr/include/timl.h\r
- cp $(CURDIR)/../src/common/cnn/timlCNN.h $(DESTDIR)/usr/include/timlCNN.h\r
- cp $(CURDIR)/../src/common/util/timlUtil.h $(DESTDIR)/usr/include/timlUtil.h\r
- cp $(CURDIR)/../bin/libtiml.a $(DESTDIR)/usr/lib/libtiml.a\r
diff --git a/debian/changelog b/debian/changelog
index eed3d9e3cc4139979b7af67be97ca9f1b398ee08..40907475d2664aa8fff0dc5a3cd0456f863f5d25 100644 (file)
--- a/debian/changelog
+++ b/debian/changelog
-ti-ml (01.00.02.01-0ubuntu0~ppa1) trusty; urgency=medium
+ti-ml (01.00.02.00-0ubuntu0~ppa3) trusty; urgency=medium
+
+ * Update CIFAR10 Testing example
+
+ -- TI Keystone PPA <ti-keystone-ppa@list.ti.com> Thu, 26 May 2015 10:45:15 -0400
+
+
+ti-ml (01.00.02.00-0ubuntu0~ppa2) trusty; urgency=medium
* Remove the deleted files from the repository
- -- TI Keystone PPA <ti-keystone-ppa@list.ti.com> Thu, 21 May 2015 15:43:15 -0400
+ -- TI Keystone PPA <ti-keystone-ppa@list.ti.com> Thu, 26 May 2015 10:43:15 -0400
ti-ml (01.00.02.00-0ubuntu0~ppa1) trusty; urgency=medium
diff --git a/debian/changelog~ b/debian/changelog~
--- a/debian/changelog~
+++ /dev/null
@@ -1,47 +0,0 @@
-ti-ml (01.00.02.01-0ubuntu0~ppa1) trusty; urgency=medium
-
- * Remove the deleted files from the repository
-
- -- TI Keystone PPA <ti-keystone-ppa@list.ti.com> Thu, 21 May 2015 15:43:15 -0400
-
-ti-ml (01.00.02.00-0ubuntu0~ppa1) trusty; urgency=medium
-
- * Fix for compilation of the 'caffe' example
- * Enable CNN states write/read
- * Enable minimum memory mode for CNN testing
- * Enable batch mode for CNN testing/training
- * Add new layer types, accuracy layer, softmaxCost layer
- * Remove softmax layer from nonlinear layer to be a new layer type
-
- -- TI Keystone PPA <ti-keystone-ppa@list.ti.com> Thu, 21 May 2015 15:43:15 -0400
-
-ti-ml (01.00.01.00-0ubuntu0~ppa3) trusty; urgency=medium
-
- * Fixes for cross compilation
-
- -- TI Keystone PPA <ti-keystone-ppa@list.ti.com> Wed, 20 May 2015 19:04:55 -0400
-
-ti-ml (01.00.01.00-0ubuntu0~ppa2) trusty; urgency=medium
-
- * Adding .testcfg and .testignore files for HPC autotests
-
- -- TI Keystone PPA <ti-keystone-ppa@list.ti.com> Sat, 02 May 2015 16:54:33 -0400
-
-ti-ml (01.00.01.00-0ubuntu0~ppa1) trusty; urgency=medium
-
- * Added pre-downloaded images to one of the examples(appCNNClassCIFAR10)
-
- -- TI Keystone PPA <ti-keystone-ppa@list.ti.com> Fri, 01 May 2015 04:04:49 +0000
-
-ti-ml (01.00.00.00-0ubuntu0~ppa2) trusty; urgency=medium
-
- * Fixing debian/control
-
- -- TI Keystone PPA <ti-keystone-ppa@list.ti.com> Thu, 02 Apr 2015 12:44:35 -0400
-
-ti-ml (01.00.00.00-0ubuntu0~ppa1) trusty; urgency=medium
-
- * Initial release with TI Machine Learning (TIML) library.
-
- -- TI Keystone PPA <ti-keystone-ppa@list.ti.com> Mon, 23 Feb 2015 23:26:20 +0000
-
diff --git a/src/app/cnn/class/cifar10/appCNNClassCIFAR10Testing.c b/src/app/cnn/class/cifar10/appCNNClassCIFAR10Testing.c
index e75be12653ec7b22388a773130cc39c9104e8d56..b3d5e38867ec96db79994df9ba675fd14c01b3b8 100644 (file)
struct timespec endTime;
long testingTime;
int topN;
- timlUtilImageSet training;
timlUtilImageSet testing;
size_t mem1;
size_t mem2;
size_t mem3;
+ FILE *fp;
+ timlUtilImage image;
+ char str[TIML_UTIL_MAX_STR];
// init
+ int i;
err = 0;
dim = IMAGE_ROW*IMAGE_COL*IMAGE_CHANNEL;
classifyNum = 0;
timlCNNInitialize(cnn);
timlCNNLoadParamsFromFile(cnn, cnn->paramsFileName);
timlCNNSetMode(cnn, Util_Test);
+ timlCNNSetBatchSize(cnn, 1);
timlCNNPrint(cnn);
mem1 = cnn->forwardMemory + cnn->backwardMemory + cnn->fixedMemory + cnn->paramsMemory;
printf("CNN memory pool size = %10.4f MB.\n", (float)cnn->memPoolSize/1024.0/1024.0);
printf("CNN params memory size = %10.4f MB.\n", (float)cnn->paramsMemory/1024.0/1024.0);
- // read CIFAR10 database
- // printf("2. Read CIFAR10 database\n");
- // timlUtilReadCIFAR10(DATABASE_PATH, &training, &testing);
-
- testing.data = malloc(sizeof(float)*IMAGE_ROW*IMAGE_COL*IMAGE_CHANNEL*IMAGE_NUM);
- testing.label = malloc(sizeof(int)*IMAGE_NUM);
- testing.num = IMAGE_NUM;
-
- // read labels
- fp = fopen(LABEL_PATH, "rt");
- for (i = 0; i < IMAGE_NUM; i++) {
- read = fscanf(fp, "%d", testing.label + i);
- }
- fclose(fp);
-
- // read images
- for (i = 0; i < IMAGE_NUM; i++) {
- sprintf(str, IMAGE_PATH, i);
- image = timlUtilReadJPEG(str);
- cblas_scopy(dim, image.data, 1, testing.data + i*dim, 1);
- free(image.data);
- }
+// // read CIFAR10 database
+// printf("2. Read CIFAR10 database\n");
+// timlUtilReadCIFAR10(DATABASE_PATH, &training, &testing);
+ testing.data = malloc(sizeof(float)*IMAGE_ROW*IMAGE_COL*IMAGE_CHANNEL*IMAGE_NUM);
+ testing.label = malloc(sizeof(int)*IMAGE_NUM);
+ testing.num = IMAGE_NUM;
+
+ // read labels
+ fp = fopen(LABEL_PATH, "rt");
+ for (i = 0; i < IMAGE_NUM; i++) {
+ fscanf(fp, "%d", testing.label + i);
+ }
+ fclose(fp);
+
+ // read images
+ for (i = 0; i < IMAGE_NUM; i++) {
+ sprintf(str, IMAGE_PATH, i);
+ image = timlUtilReadJPEG(str);
+ cblas_scopy(dim, image.data, 1, testing.data + i*dim, 1);
+ free(image.data);
+ }
// testing
printf("3. Start testing\n");
// cleaning
printf("4. Clean up\n");
- free(training.data);
- free(training.label);
free(testing.data);
free(testing.label);
timlCNNDelete(cnn);
diff --git a/src/app/cnn/class/cifar10/appCNNClassCIFAR10Testing.c~ b/src/app/cnn/class/cifar10/appCNNClassCIFAR10Testing.c~
+++ /dev/null
@@ -1,168 +0,0 @@
-/******************************************************************************/
-/*!
- * \file appCNNClassCIFAR10Testing.c
- */
-/* Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- ******************************************************************************/
-
-
-/*******************************************************************************
- *
- * INCLUDES
- *
- ******************************************************************************/
-
-#include "../appCNNClass.h"
-
-
-/*******************************************************************************
- *
- * DEFINES
- *
- ******************************************************************************/
-
-#define MODEL_PATH "../../../../database/model/cifar10/databaseModelCIFAR10.m"
-#define DATABASE_PATH "../../../../database/cifar10"
-#define IMAGE_PATH "../../../../database/cifar10/%1d.jpg"
-#define LABEL_PATH "../../../../database/cifar10/label.txt"
-#define IMAGE_NUM 3
-#define TOP_N 1
-#define IMAGE_ROW 32
-#define IMAGE_COL 32
-#define IMAGE_CHANNEL 3
-
-
-/*******************************************************************************
- *
- * main()
- *
- ******************************************************************************/
-
-int main()
-{
- return appCNNClassCIFAR10Testing();
-}
-
-
-/******************************************************************************/
-/*!
- * \ingroup appCNNClass
- * \brief CIFAR10 testing example
- */
-/******************************************************************************/
-
-int appCNNClassCIFAR10Testing()
-{
- int err;
- int classifyNum;
- float classifyPercent;
- int dim;
- long mem;
- struct timespec startTime;
- struct timespec endTime;
- long testingTime;
- int topN;
- timlUtilImageSet training;
- timlUtilImageSet testing;
- size_t mem1;
- size_t mem2;
- size_t mem3;
-
- // init
- err = 0;
- dim = IMAGE_ROW*IMAGE_COL*IMAGE_CHANNEL;
- classifyNum = 0;
- topN = TOP_N;
-
- setbuf(stdout, NULL); // do not buffer the console output
-
- // read the CNN config file
- printf("1. Read the CNN config\n");
- timlConvNeuralNetwork *cnn = timlCNNReadFromFile(MODEL_PATH);
- timlCNNAddAccuracyLayer(cnn, TOP_N);
- timlCNNInitialize(cnn);
- timlCNNLoadParamsFromFile(cnn, cnn->paramsFileName);
- timlCNNSetMode(cnn, Util_Test);
- timlCNNPrint(cnn);
-
- mem1 = cnn->forwardMemory + cnn->backwardMemory + cnn->fixedMemory + cnn->paramsMemory;
- mem2 = cnn->forwardMemory + cnn->fixedMemory + cnn->paramsMemory;
- mem3 = cnn->memPoolSize + cnn->fixedMemory + cnn->paramsMemory;
- printf("CNN level 1 memory size = %10.4f MB.\n", (float)mem1/1024.0/1024.0);
- printf("CNN level 2 memory size = %10.4f MB.\n", (float)mem2/1024.0/1024.0);
- printf("CNN level 3 memory size = %10.4f MB.\n", (float)mem3/1024.0/1024.0);
- printf("CNN forward memory size = %10.4f MB.\n", (float)cnn->forwardMemory/1024.0/1024.0);
- printf("CNN memory pool size = %10.4f MB.\n", (float)cnn->memPoolSize/1024.0/1024.0);
- printf("CNN params memory size = %10.4f MB.\n", (float)cnn->paramsMemory/1024.0/1024.0);
-
- // read CIFAR10 database
- // printf("2. Read CIFAR10 database\n");
- // timlUtilReadCIFAR10(DATABASE_PATH, &training, &testing);
-
- testing.data = malloc(sizeof(float)*IMAGE_ROW*IMAGE_COL*IMAGE_CHANNEL*IMAGE_NUM);
- testing.label = malloc(sizeof(int)*IMAGE_NUM);
- testing.num = IMAGE_NUM;
- // read labels
- fp = fopen(LABEL_PATH, "rt");
- for (i = 0; i < IMAGE_NUM; i++) {
- read = fscanf(fp, "%d", testing.label + i);
- }
- fclose(fp);
-
- // read images
- for (i = 0; i < IMAGE_NUM; i++) {
- sprintf(str, IMAGE_PATH, i);
- image = timlUtilReadJPEG(str);
- cblas_scopy(dim, image.data, 1, testing.data + i*dim, 1);
- free(image.data);
- }
-
- // testing
- printf("3. Start testing\n");
- clock_gettime(CLOCK_REALTIME, &startTime);
- timlCNNClassifyAccuracy(cnn, testing.data, IMAGE_ROW, IMAGE_COL, IMAGE_CHANNEL, testing.label, 1, 1, testing.num, &classifyNum);
- clock_gettime(CLOCK_REALTIME, &endTime);
- testingTime = timlUtilDiffTime(startTime, endTime);
- classifyPercent = (float)classifyNum/(float)testing.num;
- printf("Testing time = %.3f s\n", testingTime/1000000.0);
- printf("Classify accuracy = %.3f %%\n", classifyPercent*100.00);
-
- // cleaning
- printf("4. Clean up\n");
- free(training.data);
- free(training.label);
- free(testing.data);
- free(testing.label);
- timlCNNDelete(cnn);
-
- return err;
-}
diff --git a/src/app/makefile~ b/src/app/makefile~
--- a/src/app/makefile~
+++ /dev/null
@@ -1,182 +0,0 @@
-################################################################################
-#
-# makefile
-#
-# Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the
-# distribution.
-#
-# Neither the name of Texas Instruments Incorporated nor the names of
-# its contributors may be used to endorse or promote products derived
-# from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-################################################################################
-
-UNAME_M :=$(shell uname -m)
-ifneq (,$(findstring 86, $(UNAME_M)))
- # In a cross compile environment we are assuming that the EVM file system
- # is located on the build host and necessary ARM libraries are installed
- # on that file system.
- ifneq ($(MAKECMDGOALS),clean)
- ifeq ($(TARGET_ROOTDIR),)
- $(error Environment variable TARGET_ROOTDIR must be defined. Set it to point at the EVM root file system)
- endif
- endif
-
- # gcc ARM cross compiler will not, by default, search the host's
- # /usr/include. Explicitly specify here to find dependent vendor headers
-CC = arm-linux-gnueabihf-gcc
-CPPC = arm-linux-gnueabihf-g++
-AR = arm-linux-gnueabihf-ar
-else
-CC = gcc
-CPPC = g++
-AR = @ar
-endif
-
-
-
-C_INCLUDE_PATH = ../common/api ../common/cnn ../common/util \
-$(TARGET_ROOTDIR)/usr/include
-C_INCLUDE_PATH_FLAG = $(foreach d, $(C_INCLUDE_PATH), -I$d)
-C_LIB = timl cblas_armplusdsp blis OpenCL stdc++ rt jpeg m
-C_LIB_FLAG = $(foreach d, $(C_LIB), -l$d)
-C_LIB_PATH = $(TARGET_ROOTDIR)/usr/lib ../../bin
-C_LIB_PATH_FLAG = $(foreach d, $(C_LIB_PATH), -L$d)
-CFLAGS += -g -O3 -fopenmp
-LD_FLAGS=-L$(TARGET_ROOTDIR)/lib -L$(TARGET_ROOTDIR)/usr/lib -Wl,-rpath-link,$(TARGET_ROOTDIR)/lib -Wl,-rpath-link,$(TARGET_ROOTDIR)/usr/lib
-
-ARFLAGS = -rcs
-RM = @rm
-RMFLAGS += -fr
-
-
-# APP CNN CLASS
-APP_CNN_CLASS_BIN_CFILES = $(shell find ./cnn/class -name "*.c")
-APP_CNN_CLASS_BIN_OBJS = $(patsubst %.c, %.o, $(APP_CNN_CLASS_BIN_CFILES))
-APP_CNN_CLASS_BINS = $(patsubst %.c, %.bin, $(APP_CNN_CLASS_BIN_CFILES))
-APP_CNN_CLASS_HFILES = $(shell find ./cnn/class -name "*.h")
-
-# APP CNN SL
-APP_CNN_SL_BIN_HFILES = $(shell find ./cnn/scene -name "*.h")
-APP_CNN_SL_BIN_CFILES = $(shell find ./cnn/scene/sbd -name "*.c")
-APP_CNN_SL_BIN_OBJS = $(patsubst %.c, %.o, $(APP_CNN_SL_BIN_CFILES))
-APP_CNN_SL_BINS = $(patsubst %.c, %.bin, $(APP_CNN_SL_BIN_CFILES))
-APP_CNN_SL_CFILES = $(shell find ./cnn/scene -name "*.c")
-APP_CNN_SL_OBJS = $(patsubst %.c, %.o, $(APP_CNN_SL_CFILES))
-APP_CNN_SL_AUX_OBJS = $(filter-out $(APP_CNN_SL_BIN_OBJS), $(APP_CNN_SL_OBJS))
-
-# APP CNN INTEROP CAFFE
-APP_CNN_INTEROP_CAFFE_BIN_CFILES = $(shell find ./cnn/interop/caffe -name "*.cpp")
-APP_CNN_INTEROP_CAFFE_BIN_OBJS = $(patsubst %.cpp, %.o, $(APP_CNN_INTEROP_CAFFE_BIN_CFILES))
-APP_CNN_INTEROP_CAFFE_BINS = ./cnn/interop/caffe/appCNNInteropCaffe.bin
-APP_CNN_INTEROP_CAFFE_HFILES = $(shell find ./cnn/interop/caffe -name "*.hpp")
-
-# APP CNN CONVERT IMAGENET
-APP_CNN_CONVERT_IMAGENET_BIN_CFILES = $(shell find ./cnn/convert/imagenet -name "*.cpp")
-APP_CNN_CONVERT_IMAGENET_BIN_OBJS = $(patsubst %.cpp, %.o, $(APP_CNN_CONVERT_IMAGENET_BIN_CFILES))
-APP_CNN_CONVERT_IMAGENET_BINS = ./cnn/convert/imagenet/appCNNConvertImageNet.bin
-APP_CNN_CONVERT_IMAGENET_HFILES = $(shell find ./cnn/convert/imagenet -name "*.hpp")
-
-# APP CNN CONVERT SBD
-APP_CNN_CONVERT_SBD_BIN_CFILES = $(shell find ./cnn/convert/sbd -name "*.cpp")
-APP_CNN_CONVERT_SBD_BIN_OBJS = $(patsubst %.cpp, %.o, $(APP_CNN_CONVERT_SBD_BIN_CFILES))
-APP_CNN_CONVERT_SBD_BINS = ./cnn/convert/sbd/appCNNConvertSBD.bin
-APP_CNN_CONVERT_SBD_HFILES = $(shell find ./cnn/convert/sbd -name "*.hpp")
-
-
-APP_CNN_BINS = \
-$(APP_CNN_CLASS_BINS) \
-$(APP_CNN_SL_BINS) \
-$(APP_CNN_CONVERT_IMAGENET_BINS) \
-$(APP_CNN_CONVERT_SBD_BINS) \
-$(APP_CNN_INTEROP_CAFFE_BINS)
-
-APP_CNN_OBJS = \
-$(APP_CNN_CLASS_BIN_OBJS) \
-$(APP_CNN_SL_OBJS) \
-$(APP_CNN_INTEROP_CAFFE_BIN_OBJS) \
-$(APP_CNN_CONVERT_IMAGENET_BIN_OBJS) \
-$(APP_CNN_CONVERT_SBD_BIN_OBJS)
-
-all: $(APP_CNN_BINS)
-
-clean:
- $(RM) $(RMFLAGS) \
- $(APP_CNN_OBJS) \
- $(APP_CNN_BINS)
-
-# appCNNClass bins
-$(APP_CNN_CLASS_BINS): %.bin: %.o
- $(CC) $(CFLAGS) $(LD_FLAGS) -o $@ $^ \
- $(C_LIB_FLAG) $(C_LIB_PATH_FLAG)
-
-# appCNNClass objs
-$(APP_CNN_CLASS_BIN_OBJS): %.o: %.c $(APP_CNN_CLASS_HFILES)
- $(CC) -c $(CFLAGS) $(LD_FLAGS) -o $@ $< \
- $(C_INCLUDE_PATH_FLAG)
-
-# appCNNScene bins
-$(APP_CNN_SL_BINS): %.bin: %.o $(APP_CNN_SL_AUX_OBJS)
- $(CC) $(CFLAGS) $(LD_FLAGS) -o $@ $^ \
- $(C_LIB_FLAG) $(C_LIB_PATH_FLAG)
-
-# appCNNScene objs
-$(APP_CNN_SL_OBJS): %.o: %.c $(APP_CNN_SL_HFILES)
- $(CC) -c $(CFLAGS) $(LD_FLAGS) -o $@ $< \
- $(C_INCLUDE_PATH_FLAG)
-
-# appCNNConvertImageNet bins
-$(APP_CNN_CONVERT_IMAGENET_BINS): $(APP_CNN_CONVERT_IMAGENET_BIN_OBJS)
- $(CPPC) $(CFLAGS) $(LD_FLAGS) -o $(APP_CNN_CONVERT_IMAGENET_BINS) $^ \
- -lopencv_core -lopencv_highgui -lopencv_imgproc \
- $(C_LIB_PATH_FLAG)
-
-# appCNNConvertImageNet objs
-$(APP_CNN_CONVERT_IMAGENET_BIN_OBJS): %.o: %.cpp $(APP_CNN_CONVERT_IMAGENET_HFILES)
- $(CPPC) -c $(CFLAGS) $(LD_FLAGS) -o $@ $< \
- $(C_INCLUDE_PATH_FLAG)
-
-# appCNNConvertSBD bins
-$(APP_CNN_CONVERT_SBD_BINS): $(APP_CNN_CONVERT_SBD_BIN_OBJS)
- $(CPPC) $(CPPFLAGS) $(LD_FLAGS) -o $(APP_CNN_CONVERT_SBD_BINS) $^ \
- -lopencv_core -lopencv_highgui -lopencv_imgproc \
- $(C_LIB_PATH_FLAG)
-
-# appCNNConvertSBD objs
-$(APP_CNN_CONVERT_SBD_BIN_OBJS): %.o: %.cpp $(APP_CNN_CONVERT_SBD_HFILES)
- $(CPPC) -c $(CFLAGS) $(LD_FLAGS) -o $@ $< \
- $(C_INCLUDE_PATH_FLAG)
-
-# appCNNInteropCaffe bins
-$(APP_CNN_INTEROP_CAFFE_BINS): $(APP_CNN_INTEROP_CAFFE_BIN_OBJS)
- $(CPPC) $(CFLAGS) $(LD_FLAGS) -o $(APP_CNN_INTEROP_CAFFE_BINS) $^ \
- -lprotobuf \
- $(C_LIB_FLAG) $(C_LIB_PATH_FLAG)
-
-# appCNNInteropCaffe objs
-$(APP_CNN_INTEROP_CAFFE_BIN_OBJS): %.o: %.cpp $(APP_CNN_INTEROP_CAFFE_HFILES)
- $(CPPC) -c $(CFLAGS) $(LD_FLAGS) -o $(LD_FLAGS) $@ $< \
- $(C_INCLUDE_PATH_FLAG)
index 6298dada14af01967f9d89962c5905703207953f..451c203d6905e211f8974cea41b03486c6c8532e 100644 (file)
case CNN_SoftmaxCost:\r
layer->batchSize = layer->prev->batchSize;\r
break;\r
+ case CNN_Softmax:\r
+ layer->batchSize = layer->prev->batchSize;\r
+ break;\r
default:\r
break;\r
}\r