This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdint.h> | |
uint32_t basetable[512]; | |
uint32_t shifttable[512]; | |
void generatetables(){ | |
unsigned int i; | |
int e; | |
for(i=0; i<256; ++i){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ccv_size_t size = ccv_size(257, 257); | |
for (i = 0; i < categorizeds->rnum; i++) | |
{ | |
ccv_categorized_t* categorized = (ccv_categorized_t*)ccv_array_get(categorizeds, i); | |
ccv_dense_matrix_t* image = 0; | |
ccv_read(categorized->file.filename, &image, CCV_IO_ANY_FILE | CCV_IO_RGB_COLOR); | |
if (image) | |
{ | |
ccv_dense_matrix_t* norm = 0; | |
if (image->rows > size.height && image->cols > size.width) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 2d2ec7ba797e279a9196d0f6fb409f3781d174bc Mon Sep 17 00:00:00 2001 | |
From: Liu Liu <i@liuliu.me> | |
Date: Sat, 8 Feb 2014 19:25:02 -0500 | |
Subject: for testing with multiple sampling | |
--- | |
lib/cuda/cwc_convnet.cu | 203 +++++++++++++++++++++++++++++++++++++++++++++--- | |
1 file changed, 193 insertions(+), 10 deletions(-) | |
diff --git a/lib/cuda/cwc_convnet.cu b/lib/cuda/cwc_convnet.cu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
../data/INRIAPerson/Test/pos/crop_000001.png 151 62 185 562 0.053384 | |
../data/INRIAPerson/Test/pos/crop_000002.png 104 95 116 354 0.138356 | |
../data/INRIAPerson/Test/pos/crop_000003.png 304 32 125 383 0.088343 | |
../data/INRIAPerson/Test/pos/crop_000004.png 152 69 85 260 0.046716 | |
../data/INRIAPerson/Test/pos/crop_000005.png 178 77 79 241 0.079528 | |
../data/INRIAPerson/Test/pos/crop_000005.png 56 49 85 260 0.040967 | |
../data/INRIAPerson/Test/pos/crop_000008.png 459 91 158 482 0.089334 | |
../data/INRIAPerson/Test/pos/crop_000009.png 307 83 200 608 0.053156 | |
../data/INRIAPerson/Test/pos/crop_000012.png 214 167 146 446 0.046018 | |
../data/INRIAPerson/Test/pos/crop_000016.png 580 77 185 562 0.133419 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static inline float cbrt_5_f32(float f) | |
{ | |
const uint32_t b1 = 709921077; | |
uint32_t* p = (uint32_t*)(&f); | |
*p = *p / 3 + b1; | |
return f; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/bin/cifar-10.c b/bin/cifar-10.c | |
index 1552aae..ca975db 100644 | |
--- a/bin/cifar-10.c | |
+++ b/bin/cifar-10.c | |
@@ -192,7 +192,7 @@ int main(int argc, char** argv) | |
}, | |
}, | |
}; | |
- ccv_convnet_t* convnet = ccv_convnet_new(1, ccv_size(32, 32), params, sizeof(params) / sizeof(ccv_convnet_layer_param_t)); | |
+ ccv_convnet_t* convnet = ccv_convnet_new(0, ccv_size(31, 31), params, sizeof(params) / sizeof(ccv_convnet_layer_param_t)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sqlite3* db = 0; | |
int h[0x10000]; | |
float kmean[0x100]; | |
uint16_t tbl[0x10000]; | |
int i, j, k; | |
for (i = 0; i < 0x10000; i++) | |
tbl[i] = i; | |
float lut[0x10000]; | |
ccv_half_precision_to_float(tbl, lut, 0x10000); | |
ccv_convnet_t* convnet = ccv_convnet_read(0, argv[1]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int f; | |
for (f = 10; f < 13; f++) | |
{ | |
int i, j, k; | |
ccv_convnet_layer_t *layer = convnet->layers + f; | |
char filename[256]; | |
float kmean[256]; | |
sprintf(filename, "lut-layer-%d.txt", f); | |
FILE *r = fopen(filename, "r"); | |
for (i = 0; i < 0x100; i++) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sqlite3* db = 0; | |
assert(SQLITE_OK == sqlite3_open(argv[2], &db)); | |
const char create_table_qs[] = | |
"CREATE TABLE IF NOT EXISTS layer_quant " | |
"(layer INTEGER PRIMARY KEY ASC, quant BLOB);"; | |
assert(SQLITE_OK == sqlite3_exec(db, create_table_qs, 0, 0, 0)); | |
const char data_insert_qs[] = | |
"REPLACE INTO layer_quant " | |
"(layer, quant) VALUES ($layer, $quant);"; | |
sqlite3_stmt* data_insert_stmt = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void ccv_convnet_read_extra(ccv_convnet_t* convnet, const char* filename) | |
{ | |
sqlite3* db = 0; | |
if (SQLITE_OK == sqlite3_open(filename, &db)) | |
{ | |
sqlite3_stmt* layer_quant_stmt = 0; | |
const char layer_quant_qs[] = | |
"SELECT layer, quant FROM layer_quant;"; | |
if (SQLITE_OK == sqlite3_prepare_v2(db, layer_quant_qs, sizeof(layer_quant_qs), &layer_quant_stmt, 0)) | |
{ |
OlderNewer