54 struct kiss_priv *priv;
67 void (*result_cb)(
float *result,
struct kiss_network* net,
void *user_data);
212void kiss_resample_spectra(
float *in_re,
float *in_im,
size_t input_length,
float **out_re,
float **out_im,
size_t output_length);
237 float thresh_factor,
bool use_second_deriv,
238 float **out_re,
float **out_im,
size_t *output_length);
252 float **out_re,
float **out_im,
size_t output_length);
263float *
kiss_absgrad(
float *in_re,
float *in_im,
float *omegas,
size_t input_length,
size_t index);
272float kiss_grad(
float *data,
float *omegas,
size_t input_length,
size_t index);
319void kiss_linear(
float* data,
float* weight,
float* bias,
size_t lengh);
float kiss_mean(float *data, size_t input_length)
Calculates the mean of the given data.
void kiss_normalize_spectra(float *in_re, float *in_im, size_t input_length)
Normalizes the given spectra to [0,1].
float * kiss_create_range(float start, float end, size_t length, bool log)
Allocates an array of floats that contins a linear or log range.
bool kiss_load_network_from_buffer_prealloc(struct kiss_network *net, const char *buffer, size_t size, void(*result_cb)(float *result, struct kiss_network *net, void *user_data), bool verbose)
Loads a network from a memory address.
void kiss_resample_spectra(float *in_re, float *in_im, size_t input_length, float **out_re, float **out_im, size_t output_length)
Resamples a spectra, useing linear interpolation.
size_t kiss_get_active_output_count(struct kiss_network *net)
Gets the number of outputs not masked by the input mask.
void kiss_softmax_masked(float *data, bool *mask, size_t input_length)
Applies softmax to the given data ignoreing the inputs where mask is false.
void kiss_softmax(float *data, size_t input_length)
Applies softmax to the given data.
const char * kiss_get_strerror(struct kiss_network *net)
Normalizes the given spectra to [0,1].
bool kiss_filter_spectra(float *in_re, float *in_im, float *omegas, size_t input_length, float **out_re, float **out_im, size_t output_length)
Filteres the spectra by applying kiss_normalize_spectra, kiss_reduce_spectra and kiss_resample_spectr...
struct kiss_network * kiss_load_network_from_buffer(const char *buffer, size_t size, void(*result_cb)(float *result, struct kiss_network *net, void *user_data), bool verbose)
Loads a network from a memory address.
void kiss_free_vector(struct kiss_vector *vector)
Frees the given vector.
bool kiss_load_network_prealloc(struct kiss_network *net, const char *path, void(*result_cb)(float *result, struct kiss_network *net, void *user_data), bool verbose)
Loads a network from disk.
float * kiss_absgrad(float *in_re, float *in_im, float *omegas, size_t input_length, size_t index)
Calculates the element wise absolute gradient at the given point of the data given.
char * kiss_eis_to_relaxis(const char *in)
Translates a string for this library to the format used by RHD instruments RelaxIS.
float kiss_grad(float *data, float *omegas, size_t input_length, size_t index)
Approximates the gradiant at the given index.
bool kiss_set_output_mask(struct kiss_network *net, const bool *output_mask)
Sets the output mask on a given network.
void kiss_free_network(struct kiss_network *net)
Frees the resources associated with a network.
void kiss_linear(float *data, float *weight, float *bias, size_t lengh)
Applies a linear nn layer to the given input.
float kiss_median(float *data, size_t input_length)
Calculates the median of the given data.
void kiss_free_network_prealloc(struct kiss_network *net)
Same as kiss_free_network except it dose not free the network struct itself.
bool kiss_async_run_inference(struct kiss_network *net, const struct kiss_vector *inputs, size_t inputs_count, void *user_data)
Runs inference on a network with the given inputs.
struct kiss_vector * kiss_create_vector(const char *name, float *values, size_t length)
Allocate a vector struct of length elements and copy the given data into the vector.
bool kiss_float_eq(float a, float b, unsigned int ulp)
Checks the given floats for equality with a tollerance of ulp epsilons around the sum of the inputs.
struct kiss_network * kiss_load_network(const char *path, void(*result_cb)(float *result, struct kiss_network *net, void *user_data), bool verbose)
Loads a network from disk.
char * kiss_eis_to_cdc(const char *in)
Translates a string for this library a Boukamp Circuit Description Code (CDC).
void kiss_free(void *data)
Frees the data with the same allocateor as libkissinference.
bool kiss_reduce_spectra(float *in_re, float *in_im, float *omegas, size_t input_length, float thresh_factor, bool use_second_deriv, float **out_re, float **out_im, size_t *output_length)
Reduces the data by removing "uninteresting" regions.
Struct describing a kiss neural network.
Definition kissinference.h:53
bool softmax
Network ends with a softmax.
Definition kissinference.h:63
float * output_scalars
Network expects outputs to be scaled by this factor to get physical values.
Definition kissinference.h:64
char ** output_labels
A description string for eatch element of the output tensor.
Definition kissinference.h:61
size_t input_count
The number of inputs the network expects.
Definition kissinference.h:57
bool * output_mask
An array of booleans that set an input enabled or disabled >
Definition kissinference.h:59
char * purpose
A string describing the purpose of the network.
Definition kissinference.h:60
struct kiss_vector * inputs
Network expects these to be given as the input.
Definition kissinference.h:56
float * output_biases
Network expects outputs to be biased by this factor to get physical values.
Definition kissinference.h:65
size_t output_size
Size of tensor this network returns.
Definition kissinference.h:58
bool ready
Specifies if the network is ready to use, must be checked after loading.
Definition kissinference.h:62
A struct containing a named vector.
Definition kissinference.h:43
float * values
The elements of the vector.
Definition kissinference.h:45
size_t length
The number of elements in this vector.
Definition kissinference.h:46
const char * name
Name or description of the data this vector holds.
Definition kissinference.h:44