Skip to content

Instantly share code, notes, and snippets.

View yashiro-gaming's full-sized avatar

yashiro-gaming

View GitHub Profile
@tomhawkin
tomhawkin / Program.cs
Created February 13, 2026 18:08
C# port of MicroGPT
// This is a C# port of @karpathy microgpt python script (https://gist.github.com/karpathy/8627fe009c40f57531cb18360106ce95)
// It's the closest I could get using C#.
// Use with caution as it could be wrong, but it does seem to get similar outputs
namespace MicroGpt;
public class Value(double data, Value[]? children = null)
{
private readonly Value[] _children = children ?? [];
private Action _backward = () => { };