diff --git a/main.cpp b/main.cpp index 116ddea..5f2fd35 100644 --- a/main.cpp +++ b/main.cpp @@ -16,11 +16,12 @@ void run_mlp(){ Context ctx; get_quant_mnist_ctx(ctx, input_x); + get_quant_mnist_ctx_s(ctx); S_TENSOR pred_tensor = ctx.get("y_pred:0"); ctx.eval(); int pred_label = *(pred_tensor->read(0, 0)); - printf("Predicted label: %d", pred_label); + printf("Predicted label: %d\r\n", pred_label); } diff --git a/mbed_app.json b/mbed_app.json index 98ecd90..76f18be 100644 --- a/mbed_app.json +++ b/mbed_app.json @@ -40,5 +40,9 @@ "sd-clk": "D13", "sd-cs": "D9" } - } -} \ No newline at end of file + }, + "macros": [ + "MBED_CONF_APP_MAIN_STACK_SIZE=8192" + ] + +} diff --git a/models/quant_mnist.cpp b/models/quant_mnist.cpp index 17c5ef5..662357f 100644 --- a/models/quant_mnist.cpp +++ b/models/quant_mnist.cpp @@ -181,6 +181,8 @@ void get_quant_mnist_ctx(Context& ctx, Tensor* input_0) { { "Layer1/Relu_eightbit_quantized:0", "Layer1/Relu_eightbit_quantized:1", "Layer1/Relu_eightbit_quantized:2" }); ctx.eval(); } +} +void get_quant_mnist_ctx_s(Context& ctx) { { TensorIdxImporter t_import; ctx.add(t_import.ubyte_import("/fs/constants/quant_mnist/Layer2_Variable_quint8_const_0.idx"), @@ -301,6 +303,7 @@ void get_quant_mnist_ctx(Context& ctx, Tensor* input_0) { { "Layer2/Relu_eightbit_quantized:0", "Layer2/Relu_eightbit_quantized:1", "Layer2/Relu_eightbit_quantized:2" }); ctx.eval(); } + { TensorIdxImporter t_import; ctx.add(t_import.ubyte_import("/fs/constants/quant_mnist/OuputLayer_Variable_quint8_const_0.idx"), diff --git a/models/quant_mnist.hpp b/models/quant_mnist.hpp index e531323..2a2097a 100644 --- a/models/quant_mnist.hpp +++ b/models/quant_mnist.hpp @@ -4,4 +4,5 @@ #define __MODELS_QUANT_MNIST_H #include "context.hpp" void get_quant_mnist_ctx(Context& ctx, Tensor* input_0); +void get_quant_mnist_ctx_s(Context& ctx); #endif // __MODELS_QUANT_MNIST_H \ No newline at end of file