Skip to content

Instantly share code, notes, and snippets.

View samueljackson92's full-sized avatar

Samuel Jackson samueljackson92

  • STFC
  • Wallingford, Oxfordshire, UK
View GitHub Profile
@samueljackson92
samueljackson92 / bayes_linear_regression.py
Created May 25, 2016 19:52
Bayesian Linear Regression.
import pymc3 as pm
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
# Create some data
n = 100
_b0 = 2
_b1 = 6
x = np.linspace(0, 1, n)
@samueljackson92
samueljackson92 / fitting.py
Created May 16, 2016 07:06
Batch Gradient Descent.
import matplotlib.pyplot as plt
import numpy as np
class BatchGradientDescent():
def __init__(self, alpha, model_func=None, deriv_func=None):
self._alpha = alpha
self._model_func = model_func
self._deriv_func = deriv_func
#include <libiomp/omp.h>
#include <stdio.h>
int main() {
#pragma omp parallel
printf("Hello from thread %d, nthreads %d\n", omp_get_thread_num(), omp_get_num_threads());
}
import scipy.stats as stats
import numpy as np
import matplotlib.pyplot as plt
# create model and obtain posterior
n_heads = 6
n = 9
grid_size = 1000
p = np.linspace(0, 1, grid_size)
prior = stats.beta.pdf(p, 10, 10)
//
// Created by Samuel Jackson on 09/03/2016.
//
#include <vtkRenderer.h>
#include <vtkRenderWindowInteractor.h>
#include <vtkRenderWindow.h>
#include <vtkSmartPointer.h>
#include <vtkPoints.h>
#include <vtkVertex.h>
@samueljackson92
samueljackson92 / load_mias.py
Created February 4, 2016 08:24
Loading an image from the MIAS dataset
from skimage import io
def load_image(path):
img = io.imread(path)
io.imshow(img)
io.show()
if __name__ == "__main__":
load_image("/Users/samuel/Downloads/mdb001.pgm")

Birthday List 2016

Name Price
Men's slippers size 10 ?
The Society of Mind - Marvin Minsky ?
Searching for ghc in path.
Found ghc at /usr/local/bin/ghc
("/usr/local/bin/ghc",["--numeric-version"])
/usr/local/bin/ghc is version 7.10.3
looking for tool ghc-pkg near compiler in /usr/local/bin
found ghc-pkg in /usr/local/bin/ghc-pkg
("/usr/local/bin/ghc-pkg",["--version"])
/usr/local/bin/ghc-pkg is version 7.10.3
("/usr/local/bin/ghc",["--supported-languages"])
("/usr/local/bin/ghc",["--info"])
@samueljackson92
samueljackson92 / .travis.yml
Last active December 4, 2015 14:34
.travis config for python that doesn't suck.
language: python
notifications:
email: false
python:
- "2.7"
cache: apt
addons:
apt:
packages:
- libatlas-dev

Recipes

Red Lentil Dal with Coconut Milk and Kale

Ingredients:

  • 3 tablespoons coconut oil
  • 1 teaspoon cumin seeds
  • 1 teaspoon fennel seeds
  • 1 teaspoon ground turmeric
  • 2 onions, halved and thinly sliced