Skip to content

Instantly share code, notes, and snippets.

View jwuphysics's full-sized avatar
💭
🌌

John F. Wu jwuphysics

💭
🌌
View GitHub Profile
@jwebcat
jwebcat / gist:5122366
Last active October 9, 2025 13:52 — forked from lemenkov/gist:1674929
Properly download from github using wget and curl
wget --no-check-certificate --content-disposition https://github.com/joyent/node/tarball/v0.7.1
# --no-check-cerftificate was necessary for me to have wget not puke about https
curl -LJO https://github.com/joyent/node/tarball/v0.7.1
@rossant
rossant / raytracing.py
Last active December 15, 2025 05:24
Very simple ray tracing engine in (almost) pure Python. Depends on NumPy and Matplotlib. Diffuse and specular lighting, simple shadows, reflections, no refraction. Purely sequential algorithm, slow execution.
"""
MIT License
Copyright (c) 2017 Cyrille Rossant
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@jakevdp
jakevdp / discrete_cmap.py
Last active June 1, 2025 11:15
Small utility to create a discrete matplotlib colormap
# By Jake VanderPlas
# License: BSD-style
import matplotlib.pyplot as plt
import numpy as np
def discrete_cmap(N, base_cmap=None):
"""Create an N-bin discrete colormap from the specified input map"""
@vmarkovtsev
vmarkovtsev / notebook.ipynb
Created March 10, 2017 10:40
lapjv blog post
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@joshfp
joshfp / 1.tabular.ipynb
Last active October 10, 2020 16:02
Fast.ai p1v1: class 4
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.
@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.
@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],
@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.
@francois-rozet
francois-rozet / flow_matching.py
Last active December 23, 2025 08:39
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