Skip to content

Instantly share code, notes, and snippets.

🤖
Home

Robin van Emden robinvanemden

View GitHub Profile
View epsilon_greedy_animation.R
library(contextual)
library(data.table)
library(animation)
## 1. Bandit Simulation ---------------------------------------------------------------------------
# Run a simulation that saves the policy's theta values
policy <- EpsilonGreedyPolicy$new(epsilon = 0.1)
bandit <- BasicBernoulliBandit$new(weights = c(0.4, 0.5, 0.3))
@robinvanemden
robinvanemden / the_assigment_problem_cookie_cutter_style_v1.R
Last active Feb 27, 2019
Movie to jury member assignment problem
View the_assigment_problem_cookie_cutter_style_v1.R
@robinvanemden
robinvanemden / delete_tag_github.txt
Created Feb 10, 2019
How to Delete a Tag on GitHub
View delete_tag_github.txt
git tag -d [tag]
git push origin :[tag]
If the tag has the same name as one of the branches, use this instead:
git tag -d [tag]
git push origin :refs/tags/[tag]
@robinvanemden
robinvanemden / bubble.pde
Last active Jul 15, 2018
Quick and easy multi monitor (1080p) multi photo slideshow in Processing 3.0
View bubble.pde
int screen_height = 1920;
int screen_width = 1080;
int image_width = 1080;
int image_height = 1350;
int top_bottom = (screen_height - image_height) / 2;
int top_bottom_border = 30;
int local_test = 1;
int local_div = 3;
@robinvanemden
robinvanemden / mam_analysis_pilot_2.R
Last active Jul 3, 2018
Music as Medicine - Pilot 2 - Data import and exploration
View mam_analysis_pilot_2.R
##############################################################################################################
#
# Project: Music as Medicine, Pilot two
# URL: https://pavlov.tech/2018/06/29/syncing-bobbi-music-as-medicine/
# Purpose: First exploration of Music as Medicine ECG data
# Date: 2018-07-03
# Author: Robin van Emden, http://pavlov.tech
# Affiliation: Jheronimus Academy of Data Science, http://jads.nl
#
##############################################################################################################
@robinvanemden
robinvanemden / electromagnet_mosfet_arduino.ino
Last active Jun 28, 2018
Control electromagnets over Arduino, making use of RFP30N06LE N-Channel MOSFET
View electromagnet_mosfet_arduino.ino
/*
Control an electromagnet over Arduino, using an RFP30N06LE N-Channel MOSFET
Developed for Arduino Uno and the MOSFET Power Control Kit, COM-12959
Created 2018
by Robin van Emden
*/
@robinvanemden
robinvanemden / cb_upgrade.txt
Created Jan 17, 2018
Couchbase Sync Gateway and Server - upgrade 1.3.1 to 1.5.1 and 4.5 to 5.0.1
View cb_upgrade.txt
# Update letsencrypt certificate (TODO: make into cronjob)
cp /etc/letsencrypt/live/cb.mnds.org/* /home/sync_gateway
chown -R sync_gateway.sync_gateway *
# Couchbase 4.5 to 5.0
service sync_gateway stop
/etc/init.d/couchbase-server stop
View couchbase_init.d
#!/bin/sh
#
# Startup / shutdown script for the couchbase server
#
# Copyright (c) 2011, Couchbase, Inc.
# All rights reserved
#
#
### BEGIN INIT INFO
# Provides: couchbase-server
View bandit.py
import random
import time
import matplotlib.pyplot as plt
import numpy as np
from numpy import linalg as la
DIM = 10.0
GRAPH_NUM = 520
View linear-thompson-contextual-bandit.py
import numpy as np
class ContextualThompson(object):
def __init__(self, d=10, R=0.01, epsilon=0.5, delta=1.0, n_arms=10):
self.n_arms = n_arms
self.d = d
self.R = R
self.delta = delta
self.epsilon = epsilon
You can’t perform that action at this time.