Skip to content

nv-quan/machine-learning-in-c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Machine Learning library written in C

An educational project to implement some features of a machine learning framework in C. This is not intended for real-world use.

Features (TODO)

  • Data loader for CSV
  • A naive implementation of matrix operations
  • Autograd feature
  • Config serialize/deserialize
  • Checkpoint saving
  • Example algorithms
    • Gradient descent for linear regression

Project structures

  • src:
    • data.c & data.h: data definition and data handling, such as Point, Matrix, Dynamic string.
    • io.c & io.h: for read/writing configs, checkpoints, etc.
    • custom_math.c & custom_math.h: for math functions like matrix multiplications.
    • gradient_descent.c & gradient_descent.h: an example for gradient descent.
    • utils.c & utils.h: utility functions.
  • tests: unit testing, using Check

Dependencies

How to build

  • GNU Autotools are required to generate build files
./autogen.sh
make
# Run tests
make check
  • To remove all build files, run ./autoremove.sh

Misc.

Coding conventions

  • C99 compatible.
  • Make a best effort to follow C89, except in cases where it makes the code harder to read (e.g., the rule for 6 significant characters for external variable names).
  • Only use goto for cleaning up in error handling, as C does not support exceptions.

About

A machine learning framework in C

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published