Skip to content

vimarsh244/micrograd-C

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

Trying to implement micrograd [yt] but in C.

Micrograd is a mini implementation for pytorch.

Usage

// Initialize the values
Value* v1 = store_value(3.0);
Value* v2 = store_value(2.5);

// Perform the operation

// Value* res1 = sub(mul(add(v3, v4), v4), v3);    // (u+v)*v - u
// Value* res2 = relu(sub(v3, v4));
Value* result = power(v1, v2);
print_value(result);

// Perform backpropagation
backward(result);

// Print the gradients
print_value(v1);
print_value(v2);

// Free  memory
free_value(v1);
free_value(v2);
free_value(result);

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages