Skip to content

Instantly share code, notes, and snippets.

View robinvanemden's full-sized avatar
🌳
⏩ ⏩

Robin van Emden robinvanemden

🌳
⏩ ⏩
View GitHub Profile
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 February 27, 2019 11:06
Movie to jury member assignment problem
@robinvanemden
robinvanemden / delete_tag_github.txt
Created February 10, 2019 13:30
How to Delete a Tag on GitHub
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 July 15, 2018 18:29
Quick and easy multi monitor (1080p) multi photo slideshow in Processing 3.0
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 July 3, 2018 10:49
Music as Medicine - Pilot 2 - Data import and exploration
##############################################################################################################
#
# 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 June 28, 2018 12:39
Control electromagnets over Arduino, making use of RFP30N06LE N-Channel MOSFET
/*
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 January 17, 2018 08:40
Couchbase Sync Gateway and Server - upgrade 1.3.1 to 1.5.1 and 4.5 to 5.0.1
# 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
#!/bin/sh
#
# Startup / shutdown script for the couchbase server
#
# Copyright (c) 2011, Couchbase, Inc.
# All rights reserved
#
#
### BEGIN INIT INFO
# Provides: couchbase-server
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
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