by Glenn Matlin / glennmatlin on all socials
- Download and copy all files in this gist to
~/.claude/ - Move the
.pyfiles to~/.claude/hooks - Restart Claude Code.
| """ | |
| Quick and dirty replication of | |
| "Winning Gold at IMO 2025 with a Model-Agnostic Verification-and-Refinement Pipeline" (https://arxiv.org/abs/2507.15855) | |
| using LangGraph. | |
| Export GOOGLE_API_KEY to run. | |
| Change the model, question and constants directly in the code (no CLI). | |
| """ | |
| import asyncio |
| import numpy as np | |
| import faiss | |
| def search_knn(xq, xb, k, distance_type=faiss.METRIC_L2): | |
| """ wrapper around the faiss knn functions without index """ | |
| nq, d = xq.shape | |
| nb, d2 = xb.shape | |
| assert d == d2 |
| import numpy as np | |
| from keras.models import Sequential | |
| from keras.layers.core import Activation, Dense | |
| training_data = np.array([[0,0],[0,1],[1,0],[1,1]], "float32") | |
| target_data = np.array([[0],[1],[1],[0]], "float32") | |
| model = Sequential() | |
| model.add(Dense(32, input_dim=2, activation='relu')) | |
| model.add(Dense(1, activation='sigmoid')) |
| local lpeg = require 'lpeg' | |
| local L = lpeg.locale() | |
| local P,V,C,Ct,S,R,Cg,Cc = | |
| lpeg.P, lpeg.V, lpeg.C, lpeg.Ct, lpeg.S, lpeg.R, lpeg.Cg, lpeg.Cc | |
| local ws = S'\r\n\f\t\v ' | |
| local ws0 = ws^0 | |
| local ws1 = ws^1 | |
| local name = S'_ ' + L.digit + L.alpha |
Thanks for all the stars.
Due to unexpected demand, I move this to a proper github repo, see here: https://github.com/chroth7/reactD3resources
I would very much like to get your PRs there, thank you!
| ;; Adapted from https://github.com/ReactiveX/RxPY/blob/master/examples/konamicode/konamicode.py | |
| (import [rx.subjects [Subject]]) | |
| (setv codes [:up :up :down :down :left :right :left :right :b :a]) | |
| (setv subject (Subject)) | |
| (setv query (-> (.window_with_count subject 10 1) | |
| (.select-many (fn [win] (.sequence-equal win codes))) | |
| (.filter (fn [equal] equal)))) |