This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| 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 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (Dijkstra and plain A* are generally not included here as there are thousands of | |
| implementations, though I've made an exception for rare Ruby and Crystal versions, | |
| and for Thor, Mapzen's enhanced A*. ) | |
| A* Ruby https://github.com/georgian-se/shortest-path | |
| A* Crystal https://github.com/petoem/a-star.cr | |
| A* (bidirectional with shortcuts) C++ https://github.com/valhalla/valhalla | |
| NBA* JS https://github.com/anvaka/ngraph.path | |
| NBA* Java https://github.com/coderodde/GraphSearchPal | |
| NBA* Java https://github.com/coderodde/FunkyPathfinding |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <lemon/smart_graph.h> | |
| #include <lemon/network_simplex.h> | |
| using namespace lemon; | |
| using namespace std; | |