dmlfw (Daniyal Machine Learning Framework)
example_dmlfw_math_operations.c

Typical usage:

#include <stdio.h>
#include <stdlib.h>
#include <dmlfw_math.h>
#include <dmlfw_error.h>
int main(void) {
char err[512], dbg[512];
if (dmlfw_error()) {
dmlfw_get_error_string(err, sizeof(err));
dmlfw_get_debug_string(dbg, sizeof(dbg));
printf("Error in sigmoid: %s\nDebug info: %s\n", err, dbg);
return EXIT_FAILURE;
}
double total = dmlfw_column_vec_double_sum(sig);
printf("Sum of sigmoid vector: %lf\n", total);
return EXIT_SUCCESS;
}
int main()
Main function to execute batch gradient descent linear regression example.
Definition batch_gd.c:316
Centralized error handling interface for the framework.
void dmlfw_get_error_string(char *error_string, uint32_t size)
Copies the last error message into the provided character buffer.
uint8_t dmlfw_error(void)
Checks if the last framework call resulted in an error.
void dmlfw_get_debug_string(char *debug_string, uint32_t size)
Copies detailed debug information about the last error into the provided character buffer.
Core mathematical operations for vectors and matrices.
dmlfw_column_vec_double * dmlfw_column_vec_double_sigmoid(dmlfw_column_vec_double *vector, dmlfw_column_vec_double *new_vector)
Applies sigmoid function element-wise to column vector.
double dmlfw_column_vec_double_sum(dmlfw_column_vec_double *vector)
Computes sum of all values in column vector.
void dmlfw_column_vec_double_destroy(dmlfw_column_vec_double *vector)
Destroys a column vector and frees its memory.
void dmlfw_column_vec_double_set(dmlfw_column_vec_double *vector, index_t index, double value)
Sets the value of an element in a column vector.
struct __dmlfw_column_vec_double dmlfw_column_vec_double
Opaque structure representing a column vector of doubles.
Definition dmlfw_vec_double.h:83
dmlfw_column_vec_double * dmlfw_column_vec_double_create_new(dimension_t rows)
Creates a new column vector of specified size.