Skip to content

Instantly share code, notes, and snippets.

Working from home

Ilya Orson IlyaOrson

Working from home
View GitHub Profile
View PlotlyJS-gapminder-data-anim.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
ForceBru /
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)
View mandelbrot-on-all-accelerators.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View eigshow.jl
# Requires installation of [GLMakie](
# Include this file as include("eigshow.jl"), then run eigshow()
using GLMakie, LinearAlgebra, Printf
# Toby Driscoll (, 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 (, MATLAB Central File Exchange. Retrieved October 25, 2021.
ChrisRackauckas /
Last active February 7, 2023 20:08
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.


Forward Pass

kimlaberinto / make_animation.jl
Created April 12, 2021 14:56
Klein Bottle Math Politcal Compass meme animation (Julia)
View make_animation.jl
## Source for math political compass klein bottle meme by @KimPLab on Twitter
## Tweet:
## Inspired by the math political compass torus meme by @jessebett
## @jessebett source code notes:
## upcycled from torus knot fibration visualization:
## Note:
ChrisRackauckas /
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 /
Last active May 23, 2023 00:06
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.


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 /
Last active May 19, 2023 11:53
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

sanzoghenzo /
Last active February 20, 2023 11:46
Compare Excel sheets with Pandas
Compare two Excel sheets
Inspired by
For the documentation, download this file and type:
python --help
import argparse
import pandas as pd