Skip to content
Snippets Groups Projects
Commit ebc9fddb authored by Hashim Sharif's avatar Hashim Sharif
Browse files

Fixing LeNet Paths

parent 0f06edc4
No related branches found
No related tags found
No related merge requests found
......@@ -9,8 +9,8 @@
#include <string.h>
#include "../../../tensor_runtime/include/tensor_runtime.h"
#include "../../include/utils.h"
#include "tensor_runtime.h"
#include "utils.h"
bool Opentuner_run = false;
......@@ -30,15 +30,16 @@ void testLenetTanh(){
int test_batch_size = 5000;
uint8_t* labels = readLabels("../model_params/lenet_params/datasets/t10k-labels-idx1-ubyte", test_batch_size);
void* input = readInputTensor("../model_params/lenet_params/datasets/t10k-images-idx3-ubyte",
CUDNN_DATA_FLOAT,
test_batch_size, 1, 28, 28);
std::string dir_prefix = std::string("../model_params/lenet_keras/");
// NOTE: Filter descriptors do NOT have batch size
// NOTE: First two dims are output channels (configurable), input channels (MUST match input channels)
// IMP: The output channels matches the trained model - not the Lenet arch proposed in Andrew Ng's class
std::string input_path = dir_prefix + std::string("input.bin");
std::string labels_path = dir_prefix + std::string("labels.bin");
std::string labels32_path = dir_prefix + std::string("labels32.bin");
// Loading Input Batch
void* input = readInputBatch(input_path.c_str(),0, 0,test_batch_size,1,28,28);
uint8_t* labels = readLabelsBatch(labels_path.c_str(), 0,test_batch_size);
void* conv1_filter = readTrainedWeights("../model_params/lenet_keras/conv1.bin",
float_type, 32, 1, 5, 5);
void* conv1_bias = readTrainedWeights("../model_params/lenet_keras/conv1_bias.bin",
......
......@@ -9,8 +9,8 @@
#include <string.h>
#include "../../tensor_runtime/include/tensor_runtime.h"
#include "../include/utils.h"
#include "tensor_runtime.h"
#include "utils.h"
bool Opentuner_run = false;
......@@ -29,17 +29,20 @@ void testLenetTanh(){
printf("********* Lenet-2 Architecture ********** \n");
// FIXIT: Extend this to batch of images - currently 5 images
int test_batch_size = 2000;
int test_batch_size = 5000;
std::string dir_prefix = std::string("../model_params/lenet_keras/");
std::string input_path = dir_prefix + std::string("input.bin");
std::string labels_path = dir_prefix + std::string("labels.bin");
std::string labels32_path = dir_prefix + std::string("labels32.bin");
uint8_t* labels = readLabels("../model_params/lenet_params/datasets/t10k-labels-idx1-ubyte", test_batch_size);
void* input = readInputTensor("../model_params/lenet_params/datasets/t10k-images-idx3-ubyte",
CUDNN_DATA_FLOAT,
test_batch_size, 1, 28, 28);
// Loading Input Batch
void* input = readInputBatch(input_path.c_str(),0, 0,test_batch_size,1,28,28);
uint8_t* labels = readLabelsBatch(labels_path.c_str(), 0,test_batch_size);
// NOTE: Filter descriptors do NOT have batch size
// NOTE: First two dims are output channels (configurable), input channels (MUST match input channels)
// IMP: The output channels matches the trained model - not the Lenet arch proposed in Andrew Ng's class
void* conv1_filter = readTrainedWeights("../model_params/lenet_keras/conv1.bin",
float_type, 32, 1, 5, 5);
void* conv1_bias = readTrainedWeights("../model_params/lenet_keras/conv1_bias.bin",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment