Skip to content

Instantly share code, notes, and snippets.

View QuantumFractal's full-sized avatar

Thomas Moll QuantumFractal

View GitHub Profile
@QuantumFractal
QuantumFractal / micrograd.jl
Created September 24, 2023 00:13
Julia Micrograd implementation with Multi-layer perceptrons + backprop
### A Pluto.jl notebook ###
# v0.19.26
using Markdown
using InteractiveUtils
# ╔═╡ 9d7b2fcb-7155-4636-97f6-4401b6f561af
using GraphViz
# ╔═╡ 8d04e8a2-5a40-11ee-1678-757abfdac18b
@QuantumFractal
QuantumFractal / micrograd.jl
Created September 23, 2023 22:07
Micrograd.jl Forward Prop
### A Pluto.jl notebook ###
# v0.19.26
using Markdown
using InteractiveUtils
# ╔═╡ 9d7b2fcb-7155-4636-97f6-4401b6f561af
begin
import Pkg
Pkg.add(path="https://github.com/abelsiqueira/GraphViz.jl#38-add-engine-attribute");
@QuantumFractal
QuantumFractal / weather_bot.py
Created February 4, 2023 18:54
Tom's First Python Script
#Twitter Bot Cronjob
#Using the python-twitter API
#[tm]
#
#Debug flag
debug_FLAG = False
#Import the Twitter API, Weather API, and time module
import twitter
import pywapi
import time, string
@QuantumFractal
QuantumFractal / pokemon.go
Created July 20, 2021 03:16
bruteforce dispatch
package main
import (
"fmt"
"reflect"
)
const NORMALLY_EFFECTIVE = "it's normally effective"
const SUPER_EFFECTIVE = "it's SUPER effective!"
const NOT_VERY_EFFECTIVE = "it's not very effective..."
package main
import (
"fmt"
"reflect"
)
const NORMALLY_EFFECTIVE = 1.0
const SUPER_EFFECTIVE = 2.0
const NOT_VERY_EFFECTIVE = 0.5
@QuantumFractal
QuantumFractal / idk.jl
Created May 2, 2021 00:41
Julia2Verilog.jl
using Cassette
Cassette.@context VCtx
mutable struct VMeta
module_name::String
f::IOStream
end
VMeta(module_name::String) = VMeta(module_name, open(module_name * ".v", "w"))
function attraction_table(n)
table = zeros(n,n)
attr_norm = Normal(1.0, 0.25)
repl_norm = Normal(-1.0, 0.5)
for index in CartesianIndices(table)
if index[1] == index[2]
table[index] = rand(attr_norm, 1)[1]
else
table[index] = rand(repl_norm, 1)[1]
@QuantumFractal
QuantumFractal / aoc_1.jl
Created December 26, 2020 03:46
aoc_1.jl
using IterTools
aoc_1_input = """1732
1972
1822
1920
1847
1718
1827
1973
@QuantumFractal
QuantumFractal / keybase.md
Created December 7, 2020 04:59
keybase.md

Keybase proof

I hereby claim:

  • I am QuantumFractal on github.
  • I am tmoll_ (https://keybase.io/tmoll_) on keybase.
  • I have a public key whose fingerprint is EB8B F9AD 3B82 237F FDFA FEAC 9BA1 C9B0 DB10 2926

To claim this, I am signing this object:

function gauss(A, i, j, ui, uj)
nw, n, ne = 1.0f0/9.0f0, 1.0f0/9.0f0, 1.0f0/9.0f0
w, c, e = 1.0f0/9.0f0, 1.0f0/9.0f0, 1.0f0/9.0f0
sw, s, se = 1.0f0/9.0f0, 1.0f0/9.0f0, 1.0f0/9.0f0
top , bottom = j - 1, uj - j
left, right = i - 1, ui - i
nw *= clamp(top * left, 0, 1)
n *= clamp(top, 0, 1)