Skip to content

Instantly share code, notes, and snippets.

View AidanRocke's full-sized avatar

Aidan Rocke AidanRocke

View GitHub Profile
@AidanRocke
AidanRocke / sphere_packing.py
Created November 30, 2019 11:36
Modelling early organogenesis as a sphere packing process
import autograd.numpy as np
from autograd import grad
def U(x):
"""
definition of the symmetric potential function
"""
return (x-50.0)**2
using Distributions
using Statistics
function monotone_approx(N::Int64,n_trials::Int64,n::Int64)
"""
inputs:
N: the range of U([-N,N])
n_trials: the number of times we generate random vectors
n: the 'dimension' of the random vector
@AidanRocke
AidanRocke / crazy_paths.jl
Last active March 27, 2019 11:00
A generative model based on the 2/3 power law
using Random
function crazy_paths(N,delta_t)
ddx, dx = 10*(2*rand(N+1) .-1.0), 10*(2*rand(N+1) .-1.0)
ddy, dy = 10*(2*rand(N+1) .-1.0), 10*(2*rand(N+1) .-1.0)
x, y = 10*(2*rand(N+1) .-1.0), 10*(2*rand(N+1) .-1.0)
using LinearAlgebra
using Random
function circuit_complexity(N)
radii = zeros(1,N);
for i=1:N
@AidanRocke
AidanRocke / local_convex_test.jl
Last active March 6, 2019 16:36
A test for local convexity
using LinearAlgebra
using Random
function local_convex_test(N)
#srand(1234)
sum = 0.0
@AidanRocke
AidanRocke / computing_gradients.tf
Created November 29, 2018 13:25
Computing gradient norms with TensorFlow
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 29 13:06:26 2018
@author: aidanrockea
"""
import numpy as np
import tensorflow as tf
import tensorflow_probability as tfp
@AidanRocke
AidanRocke / fixed_accumulated_gradients.ipynb
Created August 20, 2018 12:42
Correct example of accumulated gradients
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@AidanRocke
AidanRocke / google_translate_challenge.py
Created June 8, 2018 23:00 — forked from kingjr/google_translate_challenge.py
Find simplest google translate request that generate the maximum number of unique words
from googletrans import Translator
from itertools import product
from pandas import DataFrame, read_csv
import numpy as np
import string
import time
import os
# Get google translator object
translator = Translator()
@AidanRocke
AidanRocke / accumulated_gradients.ipynb
Last active May 9, 2018 09:23
Minimal example of accumulated gradients in TensorFlow
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@AidanRocke
AidanRocke / gitbook_on_github
Created April 28, 2018 23:20
Gitbook on Github pages
## taken from: http://sangsoonam.github.io/2016/08/02/publish-gitbook-to-your-github-pages.html
# install the plugins and build the static site
gitbook install && gitbook build
# checkout to the gh-pages branch
git checkout gh-pages
# pull the latest updates
git pull origin gh-pages --rebase