Skip to content

Instantly share code, notes, and snippets.

View IlyaOrson's full-sized avatar
🦏
Wandering

Ilya Orson IlyaOrson

🦏
Wandering
View GitHub Profile
@pat-alt
pat-alt / cp_sr.jl
Last active July 31, 2023 09:50
Symbolic Regression with Conformal Prediction Intervals.
using ConformalPrediction
using Distributions
using MLJ
using Plots
# Inputs:
N = 600
xmax = 3.0
d = Uniform(-xmax, xmax)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ForceBru
ForceBru / README.md
Last active August 10, 2022 07:54
Benchmark of Julia autodiff

Benchmark of several Julia autodiff packages (including Symbolics.jl)

The goal is to differentiate a log-likelihood function - the workhorse of probability theory, mathematical statistics and machine learning.

Here, it's the log-likelihood of a Gaussian mixture model:

normal_pdf(x::Real, mean::Real, var::Real) =
    exp(-(x - mean)^2 / (2var)) / sqrt(2π * var)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# Requires installation of [GLMakie](https://github.com/JuliaPlots/Makie.jl)
# Include this file as include("eigshow.jl"), then run eigshow()
using GLMakie, LinearAlgebra, Printf
# Toby Driscoll (driscoll@udel.edu), October 2021. Released under Creative Commons CC BY-NC 3.0 license.
# This function is inspired by EIGSHOW.M, which is held in copyright by The MathWorks, Inc and found at:
# Cleve Moler (2021). Cleve_Lab (https://www.mathworks.com/matlabcentral/fileexchange/59085-cleve_lab), MATLAB Central File Exchange. Retrieved October 25, 2021.
"""
@ChrisRackauckas
ChrisRackauckas / diffeqflux_vs_jax_results.md
Last active April 9, 2024 00:57
DiffEqFlux.jl (Julia) vs Jax on an Epidemic Model

DiffEqFlux.jl (Julia) vs Jax on an Epidemic Model

The Jax developers optimized a differential equation benchmark in this issue which used DiffEqFlux.jl as a performance baseline. The Julia code from there was updated to include some standard performance tricks and is the benchmark code here. Thus both codes have been optimized by the library developers.

Results

Forward Pass

@kimlaberinto
kimlaberinto / make_animation.jl
Created April 12, 2021 14:56
Klein Bottle Math Politcal Compass meme animation (Julia)
## Source for math political compass klein bottle meme by @KimPLab on Twitter
## Tweet: https://twitter.com/KimPLab/status/1381621398636949511
## Inspired by the math political compass torus meme by @jessebett
## https://twitter.com/jessebett/status/1379162611414138885
## @jessebett source code notes:
## upcycled from torus knot fibration visualization:
## http://www.jessebett.com/TorusKnotFibration/torusknot.html
## Note:
@ChrisRackauckas
ChrisRackauckas / neural_ode_benchmarks.md
Last active September 28, 2022 20:48
torchdiffeq vs Julia DiffEqflux Neural ODE Training Benchmark

torchdiffeq vs Julia DiffEqFlux Neural ODE Training Benchmark

The spiral neural ODE was used as the training benchmark for both torchdiffeq (Python) and DiffEqFlux (Julia) which utilized the same architecture and 500 steps of ADAM. Both achived similar objective values at the end. Results:

  • DiffEqFlux defaults: 7.4 seconds
  • DiffEqFlux optimized: 2.7 seconds
  • torchdiffeq: 288.965871299999 seconds
@ChrisRackauckas
ChrisRackauckas / diffeqflux_differentialequations_vs_torchdiffeq_results.md
Last active December 20, 2023 13:10
torchdiffeq (Python) vs DifferentialEquations.jl (Julia) ODE Benchmarks (Neural ODE Solvers)

Torchdiffeq vs DifferentialEquations.jl (/ DiffEqFlux.jl) Neural ODE Compatible Solver Benchmarks

Only non-stiff ODE solvers are tested since torchdiffeq does not have methods for stiff ODEs. The ODEs are chosen to be representative of models seen in physics and model-informed drug development (MIDD) studies (quantiative systems pharmacology) in order to capture the performance on realistic scenarios.

Summary

Below are the timings relative to the fastest method (lower is better). For approximately 1 million ODEs and less, torchdiffeq was more than an order of magnitude slower than DifferentialEquations.jl

@gene1wood
gene1wood / aws-lambda-relative-import-no-known-parent-package.md
Last active March 15, 2024 14:13
Python relative imports in AWS Lambda fail with `attempted relative import with no known parent package`

Python relative imports in AWS Lambda fail with attempted relative import with no known parent package

The Problem

In AWS Lambda if I attempt an explicit relative import like this

.
├── lambda_file.py
└── example.py