Soletta machine learning
Machine learning for IoT devices
 All Data Structures Files Functions Typedefs Enumerations Enumerator Groups Pages
Macros | Typedefs | Functions
sml.h File Reference
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>

Go to the source code of this file.

Macros

#define SML_INTERNAL_ERROR   3
 
#define SML_VARIABLE_NAME_MAX_LEN   (127)
 
#define SML_VARIABLES_LIST_FOREACH(sml, list, len, var, i)
 

Typedefs

typedef void(* sml_change_cb )(struct sml_object *sml, struct sml_variables_list *changed, void *data)
 Called every time the SML made a prediction. More...
 
typedef bool(* sml_read_state_cb )(struct sml_object *sml, void *data)
 A user defined callback to read the variables values. More...
 

Functions

bool sml_erase_knowledge (struct sml_object *sml)
 Erase all previous knowledge. More...
 
void sml_free (struct sml_object *sml)
 Frees the SML engine. More...
 
struct sml_variablesml_get_input (struct sml_object *sml, const char *name)
 Get input variable by name. More...
 
struct sml_variables_listsml_get_input_list (struct sml_object *sml)
 Return the input variables list. More...
 
struct sml_variablesml_get_output (struct sml_object *sml, const char *name)
 Get input variable by name. More...
 
struct sml_variables_listsml_get_output_list (struct sml_object *sml)
 Return the output variables list. More...
 
bool sml_load (struct sml_object *sml, const char *path)
 Load the SML state from the disk. More...
 
bool sml_load_debug_log_file (struct sml_object *sml, const char *str)
 Load to current engine the debug data logged to a file. More...
 
bool sml_load_fll_file (struct sml_object *sml, const char *filename)
 Reads a FLL file. More...
 
struct sml_variablesml_new_input (struct sml_object *sml, const char *name)
 Create a new input variable. More...
 
struct sml_variablesml_new_output (struct sml_object *sml, const char *name)
 Create a new output variable. More...
 
bool sml_predict (struct sml_object *sml)
 Make a prediction based on the most recent observations. More...
 
void sml_print_debug (struct sml_object *sml, bool full)
 Prints SML debug information. More...
 
int sml_process (struct sml_object *sml)
 Process variables and make predictions. More...
 
bool sml_remove_variable (struct sml_object *sml, struct sml_variable *variable)
 Remove a variable from the engine. More...
 
bool sml_save (struct sml_object *sml, const char *path)
 Save the SML state on the disk. More...
 
bool sml_set_debug_log_file (struct sml_object *sml, const char *str)
 Set the file to be used to debug data changes in this engine. More...
 
bool sml_set_learn_disabled (struct sml_object *sml, bool disable)
 Disable the SML learning. More...
 
bool sml_set_max_memory_for_observations (struct sml_object *sml, unsigned int max_size)
 Set maximum memory that can be used to store observation history data. More...
 
bool sml_set_output_state_changed_callback (struct sml_object *sml, sml_change_cb output_state_changed_cb, void *data)
 Register a change callback. More...
 
bool sml_set_read_state_callback (struct sml_object *sml, sml_read_state_cb read_state_cb, void *data)
 Register a read callblack. More...
 
bool sml_set_stabilization_hits (struct sml_object *sml, uint16_t hits)
 Set the stabilization hits. More...
 
int sml_variable_get_name (struct sml_object *sml, struct sml_variable *sml_variable, char *var_name, size_t var_name_size)
 Get sml_variable name. More...
 
bool sml_variable_get_range (struct sml_object *sml, struct sml_variable *sml_variable, float *min, float *max)
 Get variable range. More...
 
float sml_variable_get_value (struct sml_object *sml, struct sml_variable *sml_variable)
 Get the variable current value. More...
 
bool sml_variable_is_enabled (struct sml_object *sml, struct sml_variable *variable)
 Check if a sml_variable is enabled. More...
 
int sml_variable_set_enabled (struct sml_object *sml, struct sml_variable *variable, bool enabled)
 Enable or disable a variable. More...
 
bool sml_variable_set_range (struct sml_object *sml, struct sml_variable *sml_variable, float min, float max)
 Set variable range. More...
 
bool sml_variable_set_value (struct sml_object *sml, struct sml_variable *sml_variable, float value)
 Set the variable value. More...
 
bool sml_variables_list_contains (struct sml_object *sml, struct sml_variables_list *list, struct sml_variable *var)
 Check if sml_variable is present in a sml_variables_list. More...
 
uint16_t sml_variables_list_get_length (struct sml_object *sml, struct sml_variables_list *list)
 Get the sml_variables_list size. More...
 
struct sml_variablesml_variables_list_index (struct sml_object *sml, struct sml_variables_list *list, uint16_t index)
 Get sml_variable by index. More...