| Date | 05-05-2021 - 10-17-2023 |
| Revision | R3 |
| Author | Guillaume Dua |
| Reviewers | Loïc Joly, Antoine Morrier |
| """ | |
| The most atomic way to train and run inference for a GPT in pure, dependency-free Python. | |
| This file is the complete algorithm. | |
| Everything else is just efficiency. | |
| @karpathy | |
| """ | |
| import os # os.path.exists | |
| import math # math.log, math.exp |
| <body onload=z=c.getContext`2d`,setInterval(`c.width=W=150,Y<W&&P<Y&Y<P+E|9<p?z.fillText(S++${Y=`,9,9|z.fillRect(p`}*0,Y-=--M${Y+Y},P+E,9,W),P))):p=M=Y=S=6,p=p-6||(P=S%E,W)`,E=49) onclick=M=9><canvas id=c> |
| const first = source => { | |
| if (!source) return 'empty source' | |
| return [source[0], source.slice(1)] | |
| } | |
| // console.log('first', first('abc'), first('')) | |
| const inject = value => source => [value, source] | |
| // console.log('inject', inject(1)('123'), inject(2)('')) |
| #include <cassert> | |
| #include <iostream> | |
| #include <functional> | |
| #include <memory> | |
| #include <type_traits> | |
| #include <typeinfo> | |
| #include <typeindex> | |
| #include <utility> | |
| #include <unordered_map> |
Andy Thomason is a Senior Programmer at Genomics PLC. He has been witing graphics systems, games and compilers since the '70s and specialises in code performance.
In computer science, the event loop, message dispatcher, message loop, message pump, or run loop is a programming construct that waits for and dispatches events or messages in a program.
It works by making a request to some internal or external "event provider" (that generally blocks the request until an event has arrived), and then it calls the relevant event handler ("dispatches the event").
The event-loop may be used in conjunction with a reactor, if the event provider follows the file interface, which can be selected or 'polled' (the Unix system call, not actual polling).
The event loop almost always operates asynchronously with the message originator.
In this article, we will see how to use
CRTP,std::variantandstd::visitto increase our code performances.
| #lang racket | |
| ;; this is a stand alone simple version of the closure conversion part of the hoist pass from the tarot compiler | |
| ;; see https://rain-1.github.io/scheme for more. | |
| (require data/queue) | |
| ;; closure conversion for lambda calculus | |
| ;; | |
| ;; the input language is: |
