|
| void | noodle_reset_buffer (float *buffer, uint16_t n) |
| | Fill buffer with zeros (n floats).
|
| |
| float * | noodle_slice (float *flat, size_t W, size_t z) |
| |
| void | noodle_array_to_file (float *array, NDL_File &fo, uint16_t n) |
| | Write an array of n floats to fo (an opened file handler), one value per line. No file open and close operations.
|
| |
| void | noodle_grid_to_file (byte *grid, NDL_File &fo, uint16_t n) |
| | Write an n×n byte grid to fo (opened file handler) as bytes, row-major. No file open and close operations.
|
| |
| void | noodle_grid_to_file (float *grid, NDL_File &fo, uint16_t n) |
| | Write an n×n float grid to fo (an opened file handler), row-major.
|
| |
| void | noodle_grid_from_file (NDL_File &fi, float *buffer, uint16_t K) |
| |
|
| uint16_t | noodle_do_pooling (const float *input, uint16_t W, uint16_t K, uint16_t S, const char *fn) |
| | 2D pooling over a V×V map, writing results to a file (one float per line).Pooling mode (MAX or MEAN) is selected via NOODLE_POOL_MODE at compile time. This layer uses valid pooling. NO PADDING IS APPLIED!
|
| |
| uint16_t | noodle_do_pooling1d (float *input, uint16_t W, uint16_t K, uint16_t S, const char *fn) |
| |
| uint16_t | noodle_do_pooling (const float *input, uint16_t W, uint16_t K, uint16_t S, NDL_File &fo) |
| |
| uint16_t | noodle_do_pooling (const float *input, uint16_t W, uint16_t K, uint16_t S, float *output) |
| |
| uint16_t | noodle_do_pooling1d (float *input, uint16_t W, uint16_t K, uint16_t S, NDL_File &fo) |
| |
|
| uint16_t | noodle_do_conv1d (float *input, float *kernel, uint16_t W, uint16_t K, float *output, uint16_t P, uint16_t S) |
| |
| uint16_t | noodle_do_conv (byte *grid, const float *kernel, uint16_t K, uint16_t W, float *output, uint16_t P, uint16_t S) |
| | 2D valid/same convolution with zero padding and stride, accumulating into output.Output spatial size is V = (W - K + 2P)/S + 1.
|
| |
| uint16_t | noodle_do_bias (float *output, float bias, uint16_t n) |
| |
| uint16_t | noodle_do_bias_act (float *output, float bias, uint16_t n, Activation act) |
| | Add bias to each element of a V×V map (in-place) and optionally apply activation.
|
| |
| float | noodle_get_padded_x (byte *grid, int16_t i, int16_t j, int16_t W, int16_t P) |
| | Get padded input sample from a byte grid with zero padding.Noodle uses symmetric, stride-independent padding for all convolutions.
|
| |
| float | noodle_get_padded_x (float *grid, int16_t i, int16_t j, int16_t W, int16_t P) |
| | Get padded input sample from a float grid with zero padding.
|
| |
| uint16_t | noodle_do_conv (float *grid, const float *kernel, uint16_t K, uint16_t W, float *output, uint16_t P, uint16_t S) |
| |
|
| void | noodle_unpack_bn_params (const float *bn_params, uint16_t C, const float **gamma, const float **beta, const float **mean, const float **var) |
| |
Internal helpers and implementation details. Not intended for direct application use.
◆ noodle_array_to_file()
| void noodle_array_to_file |
( |
float * |
array, |
|
|
NDL_File & |
fo, |
|
|
uint16_t |
n |
|
) |
| |
Write an array of n floats to fo (an opened file handler), one value per line. No file open and close operations.
◆ noodle_delete_file()
| void noodle_delete_file |
( |
const char * |
fn | ) |
|
Delete a file if it exists.
◆ noodle_do_bias()
| uint16_t noodle_do_bias |
( |
float * |
output, |
|
|
float |
bias, |
|
|
uint16_t |
n |
|
) |
| |
Add a scalar bias to each element of a V×V map in-place and apply ReLU.
Convenience legacy helper used by file-streamed conv paths.
- Parameters
-
| output | Accumulator buffer of size V×V (float). |
| bias | Scalar to add to each element. |
| n | V (output width/height). |
- Returns
- V.
◆ noodle_do_bias_act()
| uint16_t noodle_do_bias_act |
( |
float * |
output, |
|
|
float |
bias, |
|
|
uint16_t |
n, |
|
|
Activation |
act |
|
) |
| |
Add bias to each element of a V×V map (in-place) and optionally apply activation.
- Parameters
-
| output | Accumulator buffer of size V×V (float). |
| bias | Scalar to add to each element. |
| n | V (output width/height). |
| act | Activation to apply (ACT_NONE or ACT_RELU). |
- Returns
- V.
◆ noodle_do_conv() [1/2]
| uint16_t noodle_do_conv |
( |
byte * |
grid, |
|
|
const float * |
kernel, |
|
|
uint16_t |
K, |
|
|
uint16_t |
W, |
|
|
float * |
output, |
|
|
uint16_t |
P, |
|
|
uint16_t |
S |
|
) |
| |
2D valid/same convolution with zero padding and stride, accumulating into output.Output spatial size is V = (W - K + 2P)/S + 1.
- Parameters
-
| grid | Input grid (bytes interpreted as values 0..255). |
| kernel | K×K float kernel. |
| K,W,P,S | See common semantics. |
| output | Accumulator buffer of size at least V×V (float). |
- Returns
- V, the output width/height.
◆ noodle_do_conv() [2/2]
| uint16_t noodle_do_conv |
( |
float * |
grid, |
|
|
const float * |
kernel, |
|
|
uint16_t |
K, |
|
|
uint16_t |
W, |
|
|
float * |
output, |
|
|
uint16_t |
P, |
|
|
uint16_t |
S |
|
) |
| |
◆ noodle_do_conv1d()
| uint16_t noodle_do_conv1d |
( |
float * |
input, |
|
|
float * |
kernel, |
|
|
uint16_t |
W, |
|
|
uint16_t |
K, |
|
|
float * |
output, |
|
|
uint16_t |
P, |
|
|
uint16_t |
S |
|
) |
| |
1D convolution with zero padding/stride, accumulating into output. Output length is V = (W - K + 2P)/S + 1.
◆ noodle_do_pooling() [1/3]
| uint16_t noodle_do_pooling |
( |
const float * |
input, |
|
|
uint16_t |
W, |
|
|
uint16_t |
K, |
|
|
uint16_t |
S, |
|
|
const char * |
fn |
|
) |
| |
2D pooling over a V×V map, writing results to a file (one float per line).Pooling mode (MAX or MEAN) is selected via NOODLE_POOL_MODE at compile time. This layer uses valid pooling. NO PADDING IS APPLIED!
- Parameters
-
| input | Input V×V map (float). |
| W | V (input width/height). |
| K | Pool kernel size (M). |
| S | Pool stride (T). |
| fn | Output filename template (receives O where applicable). |
- Returns
- V_out = (V - K)/S + 1.
◆ noodle_do_pooling() [2/3]
| uint16_t noodle_do_pooling |
( |
const float * |
input, |
|
|
uint16_t |
W, |
|
|
uint16_t |
K, |
|
|
uint16_t |
S, |
|
|
float * |
output |
|
) |
| |
◆ noodle_do_pooling() [3/3]
| uint16_t noodle_do_pooling |
( |
const float * |
input, |
|
|
uint16_t |
W, |
|
|
uint16_t |
K, |
|
|
uint16_t |
S, |
|
|
NDL_File & |
fo |
|
) |
| |
◆ noodle_do_pooling1d() [1/2]
| uint16_t noodle_do_pooling1d |
( |
float * |
input, |
|
|
uint16_t |
W, |
|
|
uint16_t |
K, |
|
|
uint16_t |
S, |
|
|
const char * |
fn |
|
) |
| |
1D MAX pooling (file output). Writes V_out values (one per line) to fn.
- Parameters
-
| input | Input length-V vector (float). |
| W | V (input length). |
| K | Pool kernel size. |
| S | Pool stride. |
| fn | Output filename (per-O when called in loops). |
- Returns
- V_out = (V - K)/S + 1.
◆ noodle_do_pooling1d() [2/2]
| uint16_t noodle_do_pooling1d |
( |
float * |
input, |
|
|
uint16_t |
W, |
|
|
uint16_t |
K, |
|
|
uint16_t |
S, |
|
|
NDL_File & |
fo |
|
) |
| |
◆ noodle_get_padded_x() [1/2]
| float noodle_get_padded_x |
( |
byte * |
grid, |
|
|
int16_t |
i, |
|
|
int16_t |
j, |
|
|
int16_t |
W, |
|
|
int16_t |
P |
|
) |
| |
Get padded input sample from a byte grid with zero padding.Noodle uses symmetric, stride-independent padding for all convolutions.
- Parameters
-
| grid | Input W×W bytes. |
| i,j | Padded coordinates in [0, W+2P). |
| W,P | See common semantics. |
- Returns
- Grid value as float, or 0 outside bounds.
◆ noodle_get_padded_x() [2/2]
| float noodle_get_padded_x |
( |
float * |
grid, |
|
|
int16_t |
i, |
|
|
int16_t |
j, |
|
|
int16_t |
W, |
|
|
int16_t |
P |
|
) |
| |
Get padded input sample from a float grid with zero padding.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
◆ noodle_grid_from_file()
| void noodle_grid_from_file |
( |
NDL_File & |
fi, |
|
|
float * |
buffer, |
|
|
uint16_t |
K |
|
) |
| |
Read an K × K grid (stored as float) from an opened file handler fi into buffer.
◆ noodle_grid_to_file() [1/2]
| void noodle_grid_to_file |
( |
byte * |
grid, |
|
|
NDL_File & |
fo, |
|
|
uint16_t |
n |
|
) |
| |
Write an n×n byte grid to fo (opened file handler) as bytes, row-major. No file open and close operations.
◆ noodle_grid_to_file() [2/2]
| void noodle_grid_to_file |
( |
float * |
grid, |
|
|
NDL_File & |
fo, |
|
|
uint16_t |
n |
|
) |
| |
Write an n×n float grid to fo (an opened file handler), row-major.
◆ noodle_read_byte()
| byte noodle_read_byte |
( |
NDL_File & |
f | ) |
|
Read a byte value fron an opened file handler and store as an integer text line.
◆ noodle_read_float()
| float noodle_read_float |
( |
NDL_File & |
f | ) |
|
Read a float up to the next newline.
◆ noodle_reset_buffer()
| void noodle_reset_buffer |
( |
float * |
buffer, |
|
|
uint16_t |
n |
|
) |
| |
Fill buffer with zeros (n floats).
◆ noodle_slice()
| float * noodle_slice |
( |
float * |
flat, |
|
|
size_t |
W, |
|
|
size_t |
z |
|
) |
| |
|
inline |
Slice a stacked [Z, W, W] tensor laid out as contiguous planes.
- Parameters
-
| flat | Pointer to base of the contiguous array. |
| W | Width/height of each 2D plane. |
| z | Plane index to slice. |
- Returns
- Pointer to the start of plane
z (no bounds checks).
◆ noodle_unpack_bn_params()
| void noodle_unpack_bn_params |
( |
const float * |
bn_params, |
|
|
uint16_t |
C, |
|
|
const float ** |
gamma, |
|
|
const float ** |
beta, |
|
|
const float ** |
mean, |
|
|
const float ** |
var |
|
) |
| |
Unpack batch normalization parameters from a flat array.
- Parameters
-
| bn_params | Pointer to the packed batch normalization parameters. |
| C | Number of channels. |
| gamma | Output pointer to the per-channel scale parameters. |
| beta | Output pointer to the per-channel shift parameters. |
| mean | Output pointer to the per-channel mean parameters. |
| var | Output pointer to the per-channel variance parameters. |
◆ noodle_write_byte()
| void noodle_write_byte |
( |
NDL_File & |
f, |
|
|
byte |
d |
|
) |
| |
Write a byte value as an integer text line to an opend file.
◆ noodle_write_float()
| void noodle_write_float |
( |
NDL_File & |
f, |
|
|
float |
d |
|
) |
| |
Write a float followed by a newline (human-readable).