/*
* Imagimob Studio 5.1.1863.65534+3456fff120ed88592409547d1c475ffb01e79493
* Copyright © 2023- Imagimob AB, All Rights Reserved.
* 
* Generated at 08/19/2024 13:59:02 UTC. Any changes will be lost.
* 
* Model ID  eb3ea4ac-1b69-4942-8cba-1d766821a2b8
* 
* Memory    Size                      Efficiency
* Buffers   256 bytes (RAM)           100 %
* Readonly  380 bytes (Flash)         100 %
* 
* Backend              tensorflow
* Keras Version        2.15.0
* Backend Model Type   Sequential
* Backend Model Name   regr_conv_ext6
* 
* Layer                          Shape           Type       Function
* Input Layer                    [8]             float      compute
*    shape = [8]
* Reshape                        [8,1]           float      compute
*    shape = [8,1]
*    trainable = True
* Convolution 1D                 [8,4]           float      compute
*    filters = 4
*    kernel_size = 5
*    dilation_rate = 1
*    strides = 1
*    padding = same
*    activation = relu
*    use_bias = True
*    trainable = True
*    weight = float[5,1,4]
*    bias = float[4]
* Batch Normalization            [8,4]           float      compute
*    epsilon = 0.001
*    trainable = True
*    scale = True
*    center = True
*    axis = 2
*    gamma = float[4]
*    beta = float[4]
*    mean = float[4]
*    variance = float[4]
* Convolution 1D                 [8,2]           float      compute
*    filters = 2
*    kernel_size = 3
*    dilation_rate = 1
*    strides = 1
*    padding = same
*    activation = relu
*    use_bias = True
*    trainable = True
*    weight = float[3,4,2]
*    bias = float[2]
* Flatten                        [16]            float      compute
* Dense                          [2]             float      compute
*    units = 2
*    use_bias = True
*    activation = relu
*    trainable = True
*    weight = float[16,2]
*    bias = float[2]
* Dense                          [1]             float      compute
*    units = 1
*    use_bias = True
*    activation = linear
*    trainable = True
*    weight = float[2,1]
*    bias = float[1]
* 
* Exported functions:
* 
* void POS_NN_compute(const float *restrict data_in, float *restrict data_out)
*    Description: Compute a forward pass
*    Parameter data_in is Input of size float[8].
*    Parameter data_out is Output of size float[1].
* 
* void POS_NN_init(void)
*    Description: Initializes buffers to initial state. This function also works as a reset function.
* 
* 
* Disclaimer:
*   The generated code relies on the optimizations done by the C compiler.
*   For example many for-loops of length 1 must be removed by the optimizer.
*   This can only be done if the functions are inlined and simplified.
*   Check disassembly if unsure.
*   tl;dr Compile using gcc with -O3 or -Ofast
*/

#ifndef _POS_NN_POSITION_NN_H_
#define _POS_NN_POSITION_NN_H_
#ifdef _MSC_VER
#pragma once
#endif

#include <stdint.h>
#define POS_NN_API_FUNCTION

// Model GUID (16 bytes)
#define POS_NN_MODEL_ID {0xac, 0xa4, 0x3e, 0xeb, 0x69, 0x1b, 0x42, 0x49, 0x8c, 0xba, 0x1d, 0x76, 0x68, 0x21, 0xa2, 0xb8}

// First nibble is bit encoding, second nibble is number of bytes
#define IMAGINET_TYPES_NONE	(0x0)
#define IMAGINET_TYPES_FLOAT32	(0x14)
#define IMAGINET_TYPES_FLOAT64	(0x18)
#define IMAGINET_TYPES_INT8	(0x21)
#define IMAGINET_TYPES_INT16	(0x22)
#define IMAGINET_TYPES_INT32	(0x24)
#define IMAGINET_TYPES_INT64	(0x28)
#define IMAGINET_TYPES_QDYN8	(0x31)
#define IMAGINET_TYPES_QDYN16	(0x32)
#define IMAGINET_TYPES_QDYN32	(0x34)

// data_in [8] (32 bytes)
#define POS_NN_DATA_IN_COUNT (8)
#define POS_NN_DATA_IN_TYPE float
#define POS_NN_DATA_IN_TYPE_ID IMAGINET_TYPES_FLOAT32
#define POS_NN_DATA_IN_SCALE (1)
#define POS_NN_DATA_IN_OFFSET (0)
#define POS_NN_DATA_IN_IS_QUANTIZED (0)

// data_out [1] (4 bytes)
#define POS_NN_DATA_OUT_COUNT (1)
#define POS_NN_DATA_OUT_TYPE float
#define POS_NN_DATA_OUT_TYPE_ID IMAGINET_TYPES_FLOAT32
#define POS_NN_DATA_OUT_SCALE (1)
#define POS_NN_DATA_OUT_OFFSET (0)
#define POS_NN_DATA_OUT_IS_QUANTIZED (0)

#define POS_NN_KEY_MAX (22)



// Return codes
#define POS_NN_RET_SUCCESS 0
#define POS_NN_RET_NODATA -1
#define POS_NN_RET_NOMEM -2

// Exported methods
void POS_NN_compute(const float *restrict data_in, float *restrict data_out);
void POS_NN_init(void);

#endif /* _POS_NN_POSITION_NN_H_ */
