This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Thanks Fast.AI | |
# Based on their apache-2.0 licensed script | |
# https://github.com/fastai/courses/blob/master/setup/install-gpu.sh | |
# | |
set -e | |
# This script is designed to work with ubuntu 16.04 LTS | |
# ensure system is updated and has basic build tools | |
sudo apt-get update | |
sudo apt-get --assume-yes upgrade |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pymc3 as pm | |
from pymc3.distributions.dist_math import bound, logpow, factln | |
from pymc3.distributions import draw_values, generate_samples | |
import theano.tensor as tt | |
import numpy as np | |
import scipy.stats.distributions | |
class ZTP(pm.Discrete): | |
def __init__(self, mu, *args, **kwargs): | |
super().__init__(*args, **kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "Arduino.h" | |
#include <Servo.h> | |
Servo myservo; | |
void setup() | |
{ | |
myservo.attach(0); | |
Serial.begin(9600); | |
} | |
void loop() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# An implementation of "Machine Learning on Sequential Data Using a Recurrent Weighted Average" using pytorch | |
# https://arxiv.org/pdf/1703.01253.pdf | |
# | |
# | |
# This is a RNN (recurrent neural network) type that uses a weighted average of values seen in the past, rather | |
# than a separate running state. | |
# | |
# Check the test code at the bottom for an example of usage, where you can compare it's performance | |
# against LSTM and GRU, at a classification task from the paper. It handily beats both the LSTM and | |
# GRU :) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## THIS IS WRONG, it'll return the wrong shape. I'll need | |
## to tweak it to make it work | |
#class Repeat(lasagne.layers.Layer): | |
# def __init__(self, incoming, n, **kwargs): | |
# super(Repeat, self).__init__(incoming, **kwargs) | |
# self.n = n | |
# | |
# def get_output_shape_for(self, input_shape): | |
# return tuple([self.n] + list(input_shape)) | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def new_folder(folder_name, content_type, parentID, key=None, read_only=False, allow_children=True): | |
if key is None: | |
key = folder_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Functor { | |
fmap: (any) => any; | |
} | |
interface Monad extends Functor { | |
bind: (any) => Monad; | |
} | |
interface Maybe extends Monad { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ghc -O2 -rtsopts -threaded -prof -fprof-auto -fforce-recomp reader.hs | |
time ./reader +RTS -K1G -sstderr -pa -A3M |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ghc -O2 -rtsopts -threaded -prof -fprof-auto -fforce-recomp reader.hs | |
time ./reader +RTS -K1G -sstderr -pa -A3M |