Skip to content

Instantly share code, notes, and snippets.

View jwuphysics's full-sized avatar
💭
🌌

John F. Wu jwuphysics

💭
🌌
View GitHub Profile
@qpwo
qpwo / _myatari.py
Last active September 29, 2025 06:25
atari realtime rl runner
#!/usr/bin/env python3
import torch, gymnasium as gym, numpy as np, time, sys, threading, os, random
import torch.multiprocessing as mp
from torch import Tensor
from bg_record import log_step, bind_logger, log_close
# torch.set_num_threads(1)
NUM_PROCS = 16
@NohTow
NohTow / train_reason_moderncolbert.py
Created May 22, 2025 12:43
Boilerplate to reproduce the training of Reason-ModernColBERT
from datasets import load_dataset
from sentence_transformers import (
SentenceTransformerTrainer,
SentenceTransformerTrainingArguments,
)
from pylate import losses, models, utils
def main():
# As ReasonIR do not re-upload the BRIGHT data, we need to load it from the original source
@VictorTaelin
VictorTaelin / a_b_challenge.md
Last active July 12, 2025 18:47
A::B Prompting Challenge: $10k to prove me wrong!

CHALLENGE

Develop an AI prompt that solves random 12-token instances of the A::B problem (defined here), with 90%+ success rate.

RULES

1. The AI will be given a <problem/> to solve.

We'll use your prompt as the SYSTEM PROMPT, and a specific instance of problem as the PROMPT, inside XML tags. Example:

@alexgleith
alexgleith / SimpleLoadS2.ipynb
Last active October 17, 2025 07:35
Simplest example for finding and loading Sentinel-2 data using Python
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hyperupcall
hyperupcall / settings.jsonc
Last active December 9, 2025 18:42
VSCode config to disable popular extensions' annoyances (telemetry, notifications, welcome pages, etc.)
// I'm tired of extensions that automatically:
// - show welcome pages / walkthroughs
// - show release notes
// - send telemetry
// - recommend things
//
// This disables all of that stuff.
// If you have more config, leave a comment so I can add it!!
{
@francois-rozet
francois-rozet / flow_matching.py
Last active November 24, 2025 19:00
Flow Matching in 100 LOC
#!/usr/bin/env python
import math
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
from sklearn.datasets import make_moons
from torch import Tensor
from tqdm import tqdm
@mayrajeo
mayrajeo / 80_vision.multichannel.ipynb
Last active May 22, 2022 08:39
vision.multichannel.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@noskill
noskill / sinkhorn_test.py
Last active February 10, 2023 16:49
sinkhorn algorithm with pytorch and numpy
import torch
import numpy
np = numpy
from geomloss import SamplesLoss # See also ImagesLoss, VolumesLoss
# preferences, need to be converted to costs
# row i = cost of moving each item from c to place i
# making cost non-negative will not changes solution matrix P
preference = numpy.asarray([[2, 2, 1 , 0 ,0],
@thomasbrandon
thomasbrandon / cifar-10-squeezenet-mishcuda.ipynb
Created October 3, 2019 06:48
MishCuda test on cifar-10 squeezenet
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.