View djalibuild.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Utils | |
```jsx | |
sudo apt-get install -y curl clang locate libdrm-dev silversearcher-ag htop | |
``` | |
**CUDA** | |
cuda 11.8 | |
```jsx |
View ciid.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module MiniOmega | |
using Cassette | |
import Base:~ | |
export sample, unif, pointwise, <|, rt | |
const ID = NTuple{N, Int} where N | |
"Ω is a hypercube" | |
struct Ω |
View car_armando.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Omega | |
# Beta distributed random variables in [0, 1] | |
p1 = beta(0.5) | |
pgood = beta(0.5) | |
pbad = beta(0.5) | |
# Function that simulates the car | |
function simulate_car(ω) | |
car_is_good = Bernoulli(ω, p1(ω), Bool) |
View galen2.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Omega | |
# Add uncertainty to this if you want | |
region_size = 30_000 | |
# The number of groups | |
ngroups = ciid(ω -> Int(floor(uniform(ω, 1, region_size)))) | |
# Produced random Boolean correlation matrix | |
function correlation_model(rng, nprobes = 10) |
View galen.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Omega | |
# Add uncertainty to this if you want | |
region_size = 30_000 | |
# The number of groups | |
ngroups = uniform(1:region_size) | |
# Produced random Boolean correlation matrix | |
function correlation_model(rng, nprobes = 10) |
View cata2.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract type Node end | |
struct Val <: Node | |
x::Int | |
end | |
cons(::Val, x) = Val(x) | |
children(val::Val) = () | |
struct Add{T1, T2} <: Node |
View cata.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simplest Version | |
abstract type Node end | |
struct Val <: Node | |
x::Int | |
end | |
children(val::Val) = () |
View cond.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Omega | |
using Debugger | |
using Omega: mem | |
"Return sequence bounded between lb ad ub" | |
function f_(ω) | |
lb = -1.0 | |
ub = 1.0 | |
xs = Float64[] | |
x = rand(ω) |
View miniomega.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module MiniOmega | |
using Random | |
# Ω Subtypes Random.AbstractRNG to be compatible with existing samplers | |
mutable struct Ω <: Random.AbstractRNG | |
data::Dict{Int, Any} # Map ids to random values | |
i::Int # Current id | |
logscore::Float64 | |
end |
View strangeseg.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Arrows | |
using NamedTuples | |
import JLD: load | |
# import Arrows.BenchmarkArrows: STD_ROTATION_MATRIX, render | |
import Images: colorview, Gray | |
using NamedTuples | |
const STD_ROTATION_MATRIX = [0.94071758 -0.33430171 -0.05738258 | |
-0.33835238 -0.91297877 -0.2280076 | |
0.02383425 0.2339063 -0.97196698] |
NewerOlder