Skip to content

Instantly share code, notes, and snippets.

// Commented version of https://twitter.com/zozuar/status/1441384708441456651
// Google-translated (with some editing) from @gam0022's version
float i, // Ray marching loop counter
e, // Volume density (the smaller the value, the higher the density)
s, // FBM scale (and loop counter)
g, // Ray's distance (also used for tunnel twirl and camera prespective)
k = .01; // Handy constant
// Ray marching loop
@karlrohe
karlrohe / PCA_on_handwritten_2s.R
Created January 7, 2022 22:48
PCA on mnist handwritten 2's
# PCA on n=6990 images of handwritten 2's, each with d = 784 pixels.
# install.packages("remotes")
# remotes::install_github("jlmelville/snedata")
# thank you jlmelville for making this data so easy to access!
library(snedata)
library(magrittr)
library(Matrix)
library(rARPACK)