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 numpy as np | |
# -- Globals | |
N_ARMS = 4 | |
N_RESOURCES = 3 | |
N_EXPLORATION_ROUNDS = 1 | |
CONSUMPTION_PER_PLAY = [ | |
[4, 0, 0], # Example: first arm consumes 4 of resource 1 and 0 of resources 2 & 3 |
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
#!/bin/bash | |
brew install foma | |
brew install libvoikko | |
git clone https://github.com/voikko/corevoikko.git | |
cd corevoikko/voikko-fi | |
make vvfst | |
make vvfst-install DESTDIR=/usr/lib/voikko | |
pip install voikko |
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
shared | s1 s2 | |
| a b c | |
| a b c | |
| a b c | |
| a b c | |
| a b c | |
| a b c | |
| a b c | |
| a b c | |
| a b c |
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
label | 1_a | 1_b | 1_c | 1_d | 2_a | 2_b | 2_c | 2_d | 3_a | 3_b | 3_c | 3_d | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | 0.2 | 0.5 | 0.3 | 0.1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
1 | 0.2 | 0.5 | 0.2 | 0.2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
0 | 0.3 | 0.8 | 0.9 | 0.2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
0 | 0.3 | 0.9 | 0.9 | 0.2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
0 | 0.9 | 0.1 | 0.1 | 0.1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
0 | 0.9 | 0.1 | 0.1 | 0.2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
1 | 0 | 0 | 0 | 0 | 0.3 | 0.8 | 0.9 | 0.2 | 0 | 0 | 0 | 0 | |
1 | 0 | 0 | 0 | 0 | 0.3 | 0.9 | 0.9 | 0.2 | 0 | 0 | 0 | 0 | |
0 | 0 | 0 | 0 | 0 | 0.2 | 0.5 | 0.2 | 0.2 | 0 | 0 | 0 | 0 |
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
label | a | b | c | d | |
---|---|---|---|---|---|
1 | 0.2 | 0.5 | 0.3 | 0.1 | |
2 | 0.3 | 0.8 | 0.9 | 0.2 | |
2 | 0.3 | 0.9 | 0.9 | 0.2 | |
3 | 0.9 | 0.1 | 0.1 | 0.1 | |
3 | 0.9 | 0.1 | 0.1 | 0.2 | |
1 | 0.2 | 0.5 | 0.2 | 0.2 |
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 numpy as np | |
import multiprocessing | |
from joblib import Parallel, delayed | |
np.random.seed(0) | |
# the function we want to optimize | |
def f(w): | |
reward = -np.sum(np.square(solution - w)) | |
return reward |
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 socket | |
from flask import Flask | |
from flask import jsonify | |
from flask import request | |
VW_HOST = '127.0.0.1' | |
VW_PORT = 26542 | |
BUFFER_SIZE = 1024*10 |
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 socket | |
from flask import Flask | |
from flask import jsonify | |
from flask import request | |
VW_HOST = '127.0.0.1' | |
VW_PORT = 26542 | |
BUFFER_SIZE = 1024*10 |
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 6.
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
Term,Explanation | |
model,"one or more functions trying to explain some system/environment works. Most models are terrible approximations of the real world, but some are less terrible than others. The whole idea of machine learning is to find the least terrible model for a particular problem. Yes, we're pessimists." | |
regression,"predicting a number; e.g. predicting someone's income based on their education, country and so on." | |
logistic regression, "classification; predicting if something belongs to a particular class ('is this photo a photo of a cat or a dog?'). Logistic regression is one of many learning algorithms for classification." | |
feature engineering, "massaging data so that it yields the most predictive power; generating variables from data that fit our understanding of the context we're trying to model but are not found as-is in the raw data we are using." | |
hypothesis space, "a set of possible functions. It's machine learning's job to learn which of these possible functions best approximates the relationsh |
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
# Python implementation of the EXP3 (Exponential weight for Exploration and Exploitation) | |
# algorithm for solving adversarial bandit problems. Based on the original paper: | |
# http://rob.schapire.net/papers/AuerCeFrSc01.pdf | |
import numpy as np | |
import time | |
np.random.seed(12345) | |
n_arms = 4 |
NewerOlder