Skip to content

Instantly share code, notes, and snippets.

Working from home

Ilya Orson IlyaOrson

Working from home
View GitHub Profile
kimlaberinto / make_animation.jl
Created Apr 12, 2021
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 Dec 14, 2020
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 Jul 10, 2021
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 Oct 18, 2021
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 Sep 18, 2021
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
View A hack for showing LaTeX formulas in GitHub


A lot of GitHub projects need to have pretty math formulas in READMEs, wikis or other markdown pages. The desired approach would be to just write inline LaTeX-style formulas like this:

$e^{i \pi} = -1$

Unfortunately, GitHub does not support inline formulas. The issue is tracked here.


"""Provides methods around syncing and usage of AWS s3 buckets as local caches rather than individually
downloading every file"""
import os
import shutil
import boto3 as boto
import multiprocessing
import copy
import hashlib
mbostock / .block
Created Aug 11, 2017
Municipalities of Mexico II
View .block
border: no
height: 600
license: gpl-3.0
karpathy /
Created May 30, 2016
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward
brendanvinson / L.TopoJSON.js
Last active Sep 30, 2020 — forked from rclark/L.TopoJSON.js
TopoJSON Leaflet plugin
View L.TopoJSON.js
First run npm install topojson --save and then link "node_modules/topojson/build/topojson.min.js"
above this snippet in your html.
L.TopoJSON = L.GeoJSON.extend({
addData: function (data) {
var geojson, key;