Skip to content
This repository has been archived by the owner on Jan 12, 2019. It is now read-only.

models/generated: regenerate number models #15

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
412 changes: 273 additions & 139 deletions models/generated/modelc_01266c1b.cpp

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions models/generated/modelc_01266c1b.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

//
// DO NOT EDIT HERE.
// Autogenerated from models/conv/ms_n19_10b_nk8-0_fs0-3-3_ps0-3-3_h32_bm-valid_ib-True_b50_lr0.25_conv.model.pkl
// Autogenerated from models/conv/numbers0.model.pkl
//


Expand All @@ -15,7 +15,7 @@
typedef Eigen::Matrix<float, 27, 19, Eigen::RowMajor> ModelCInput_01266c1b;
typedef Eigen::Matrix<float, 10, 1, Eigen::ColMajor> ModelCOutput_01266c1b;

DMZ_INTERNAL ModelCOutput_01266c1b applyc_01266c1b(const ModelCInput_01266c1b& input);
DMZ_INTERNAL ModelCOutput_01266c1b applyc_01266c1b(const ModelCInput_01266c1b& input, bool test_generated_models = false);


#if TEST_GENERATED_MODELS
Expand Down
412 changes: 273 additions & 139 deletions models/generated/modelc_5c241121.cpp

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions models/generated/modelc_5c241121.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

//
// DO NOT EDIT HERE.
// Autogenerated from models/conv/ms_n19_10e2_nk8-0_fs0-3-3_ps0-3-3_h32_bm-valid_ib-True_b50_lr0.25_conv.model.pkl
// Autogenerated from models/conv/numbers1.model.pkl
//


Expand All @@ -15,7 +15,7 @@
typedef Eigen::Matrix<float, 27, 19, Eigen::RowMajor> ModelCInput_5c241121;
typedef Eigen::Matrix<float, 10, 1, Eigen::ColMajor> ModelCOutput_5c241121;

DMZ_INTERNAL ModelCOutput_5c241121 applyc_5c241121(const ModelCInput_5c241121& input);
DMZ_INTERNAL ModelCOutput_5c241121 applyc_5c241121(const ModelCInput_5c241121& input, bool test_generated_models = false);


#if TEST_GENERATED_MODELS
Expand Down
412 changes: 273 additions & 139 deletions models/generated/modelc_b00bf70c.cpp

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions models/generated/modelc_b00bf70c.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

//
// DO NOT EDIT HERE.
// Autogenerated from models/conv/ms_n19_10f_nk8-0_fs0-3-3_ps0-3-3_h32_bm-valid_ib-True_b50_lr0.25_conv.model.pkl
// Autogenerated from models/conv/numbers2.model.pkl
//


Expand All @@ -15,7 +15,7 @@
typedef Eigen::Matrix<float, 27, 19, Eigen::RowMajor> ModelCInput_b00bf70c;
typedef Eigen::Matrix<float, 10, 1, Eigen::ColMajor> ModelCOutput_b00bf70c;

DMZ_INTERNAL ModelCOutput_b00bf70c applyc_b00bf70c(const ModelCInput_b00bf70c& input);
DMZ_INTERNAL ModelCOutput_b00bf70c applyc_b00bf70c(const ModelCInput_b00bf70c& input, bool test_generated_models = false);


#if TEST_GENERATED_MODELS
Expand Down
45 changes: 26 additions & 19 deletions models/generated/modelm_befe75da.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@

//
// DO NOT EDIT HERE.
// Autogenerated from models/mlp/strips_sharded_crop_grad_d2_norm_n50_b150_mlp.model.pkl
// Autogenerated from models/mlp/strips.model.pkl
//


#include "compile.h"
#if COMPILE_DMZ

#define EIGEN_NO_DEBUG 1 // turn off range checking and anything else that could slow us down!

#include "modelm_befe75da.hpp"


// Hidden layer 1 of 1

static uint8_t data_b3289e07[40800] EIGEN_ALIGN_TO_BOUNDARY(16) = { // hidden W
0xD9, 0x30, 0x8D, 0x3E, 0x55, 0x3D, 0x97, 0x3D, 0xA8, 0x9A, 0x2B, 0xBD, 0x01, 0xA5, 0x0F, 0xBE, 0xFF, 0xEF, 0xA3, 0xBE, 0xB0, 0x15, 0xD0, 0xBE,
0xD0, 0xBD, 0x21, 0xBE, 0x4D, 0x76, 0xF0, 0xBC, 0x59, 0xA0, 0x68, 0x3D, 0xC8, 0x93, 0xBE, 0xBC, 0xE7, 0xFE, 0x0A, 0xBE, 0x0E, 0x62, 0x82, 0xBD,
Expand Down Expand Up @@ -1728,6 +1729,13 @@ static uint8_t data_dd02e979[200] EIGEN_ALIGN_TO_BOUNDARY(16) = { // hidden b
0xD3, 0xEE, 0x66, 0x3E, 0xEB, 0x02, 0x2F, 0xBF,
}; // data_dd02e979 (hidden b)

typedef Eigen::Matrix<float, 50, 204, Eigen::RowMajor> ModelMHiddenW_befe75da_1;
typedef Eigen::Matrix<float, 50, 1, Eigen::ColMajor> ModelMHiddenB_befe75da_1;
typedef Eigen::Matrix<float, 50, 1, Eigen::ColMajor> ModelMIntermediateResult_befe75da_1;


// Logistic layer

static uint8_t data_209a6565[600] EIGEN_ALIGN_TO_BOUNDARY(16) = { // logistic W
0xAD, 0xD8, 0x84, 0x3F, 0x32, 0x43, 0xBC, 0xBF, 0x61, 0x88, 0xC4, 0x3F, 0x35, 0xDB, 0xB3, 0xBF, 0x3E, 0xB0, 0x37, 0xC0, 0x7B, 0x90, 0xB2, 0xBF,
0x44, 0xDC, 0x0D, 0xC0, 0x03, 0xF1, 0x03, 0xC0, 0x95, 0xD4, 0x97, 0x3F, 0xC0, 0x01, 0xEB, 0xBF, 0xEC, 0xC9, 0xD5, 0x3F, 0x6E, 0xA3, 0xC2, 0x3F,
Expand Down Expand Up @@ -1761,24 +1769,23 @@ static uint8_t data_da0dff50[12] EIGEN_ALIGN_TO_BOUNDARY(16) = { // logistic b
}; // data_da0dff50 (logistic b)


typedef Eigen::Matrix<float, 50, 204, Eigen::RowMajor> ModelMHiddenW_befe75da;
typedef Eigen::Matrix<float, 50, 1, Eigen::ColMajor> ModelMHiddenB_befe75da;
typedef Eigen::Matrix<float, 50, 1, Eigen::ColMajor> ModelMIntermediateResult_befe75da;
typedef Eigen::Matrix<float, 3, 50, Eigen::RowMajor> ModelMLogisticW_befe75da;
typedef Eigen::Matrix<float, 3, 1, Eigen::ColMajor> ModelMLogisticB_befe75da;

DMZ_INTERNAL ModelMOutput_befe75da applym_befe75da(const ModelMInput_befe75da& input) {
Eigen::Map<ModelMHiddenW_befe75da, Eigen::Aligned> hidden_W((float *)data_b3289e07);
Eigen::Map<ModelMHiddenB_befe75da, Eigen::Aligned> hidden_b((float *)data_dd02e979);

ModelMIntermediateResult_befe75da intermediate_result = hidden_W * input + hidden_b;
intermediate_result = intermediate_result.unaryExpr(std::ptr_fun(tanhf));
// Hidden layer 1 of 1
Eigen::Map<ModelMHiddenW_befe75da_1, Eigen::Aligned> hidden_W_1((float *)data_b3289e07);
Eigen::Map<ModelMHiddenB_befe75da_1, Eigen::Aligned> hidden_b_1((float *)data_dd02e979);
ModelMIntermediateResult_befe75da_1 intermediate_result_1 = hidden_W_1 * input + hidden_b_1;
intermediate_result_1 = intermediate_result_1.unaryExpr(std::ptr_fun(tanhf));

// Logistic layer
Eigen::Map<ModelMLogisticW_befe75da, Eigen::Aligned> logistic_W((float *)data_209a6565);
Eigen::Map<ModelMLogisticB_befe75da, Eigen::Aligned> logistic_b((float *)data_da0dff50);

ModelMOutput_befe75da output = logistic_W * intermediate_result + logistic_b;
ModelMOutput_befe75da output = logistic_W * intermediate_result_1 + logistic_b;
output = output.unaryExpr(std::ptr_fun(expf));

float sum = output.sum();
output /= sum;

Expand All @@ -1790,7 +1797,7 @@ DMZ_INTERNAL ModelMOutput_befe75da applym_befe75da(const ModelMInput_befe75da& i

#include <iostream>

static uint8_t data_93d4c7ac[816] EIGEN_ALIGN_TO_BOUNDARY(16) = { // test input
static uint8_t data_93d4c7ac_befe75da[816] EIGEN_ALIGN_TO_BOUNDARY(16) = { // test input
0x46, 0x41, 0xAE, 0x3C, 0x45, 0x9D, 0x58, 0x3F, 0x23, 0x19, 0x59, 0x3F, 0x1D, 0x19, 0xD6, 0x3E, 0xDB, 0x2C, 0xC9, 0x3E, 0xA3, 0x68, 0x48, 0x3D,
0x40, 0xFF, 0xDB, 0x3E, 0x1A, 0x75, 0x62, 0x3F, 0xA5, 0xCD, 0x78, 0x3F, 0x4E, 0xDE, 0x1F, 0x3F, 0xC9, 0x10, 0xD2, 0x3E, 0x3A, 0x62, 0xC6, 0x3E,
0x59, 0xC1, 0x6B, 0x3E, 0x56, 0xE0, 0x37, 0x3F, 0x84, 0x91, 0x50, 0x3F, 0x93, 0x45, 0x85, 0x3C, 0xB8, 0x75, 0x34, 0x3F, 0xC4, 0xFF, 0x2C, 0x3F,
Expand Down Expand Up @@ -1825,19 +1832,19 @@ static uint8_t data_93d4c7ac[816] EIGEN_ALIGN_TO_BOUNDARY(16) = { // test input
0x69, 0x2F, 0x68, 0x3F, 0xD3, 0x37, 0x60, 0x3F, 0x89, 0xEF, 0x44, 0x3F, 0x0B, 0x01, 0x27, 0x3E, 0xAC, 0x2C, 0xF3, 0x3E, 0x0F, 0x39, 0x3B, 0x3F,
0x76, 0x63, 0x58, 0x3F, 0xCB, 0xA2, 0x3D, 0x3E, 0x4F, 0xCD, 0x5E, 0x3F, 0x43, 0x22, 0x12, 0x3E, 0xC5, 0x1B, 0x01, 0x3F, 0xCA, 0x96, 0x30, 0x3F,
0x1C, 0x2B, 0x76, 0x3F, 0xBD, 0x77, 0x4B, 0x3F, 0xFB, 0x2F, 0x9E, 0x3E, 0x03, 0x1B, 0x41, 0x3F, 0x13, 0x0B, 0x31, 0x3F, 0x0B, 0x11, 0x69, 0x3C,
}; // data_93d4c7ac (test input)
}; // data_93d4c7ac_befe75da (test input)

static uint8_t data_b8937695[12] EIGEN_ALIGN_TO_BOUNDARY(16) = { // test output
static uint8_t data_b8937695_befe75da[12] EIGEN_ALIGN_TO_BOUNDARY(16) = { // test output
0xBF, 0xFF, 0x7F, 0x3F, 0xA1, 0x06, 0x6A, 0x36, 0xE2, 0x73, 0xDA, 0x34,
}; // data_b8937695 (test output)
}; // data_b8937695_befe75da (test output)


bool passm_befe75da() {
Eigen::Map<ModelMInput_befe75da, Eigen::Aligned> test_input((float *)data_93d4c7ac);
Eigen::Map<ModelMInput_befe75da, Eigen::Aligned> test_input((float *)data_93d4c7ac_befe75da);
ModelMOutput_befe75da computed_output = applym_befe75da(test_input);
Eigen::Map<ModelMOutput_befe75da, Eigen::Aligned> known_good_output((float *)data_b8937695);
Eigen::Map<ModelMOutput_befe75da, Eigen::Aligned> known_good_output((float *)data_b8937695_befe75da);

if(((computed_output.array() - known_good_output.array()).abs() > 1e-5f).any()) {
if(((computed_output.array() - known_good_output.array()).abs() > (float)1e-5).any()) {
// TODO: Return more useful info here, rather than printing to stderr...
std::cerr << "MLP model befe75da test failure:\nGot " << computed_output << "\nExpected " << known_good_output << "\n";
return false;
Expand Down
2 changes: 1 addition & 1 deletion models/generated/modelm_befe75da.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

//
// DO NOT EDIT HERE.
// Autogenerated from models/mlp/strips_sharded_crop_grad_d2_norm_n50_b150_mlp.model.pkl
// Autogenerated from models/mlp/strips.model.pkl
//


Expand Down