Example #1
0
def read_single_map(abs_path):
    m = np.loadtxt(open(abs_path, "rb"), delimiter=",")
    x = [[i for i in range(0, len(m))] for j in range(0, len(m))]
    y = [[j for i in range(0, len(m))] for j in range(0, len(m))]

    # 3d plot

    #fig = plt.figure()
    #ax = fig.gca(projection='3d')
    #ax.plot_surface(x,y,m, cmap="gist_earth")
    #plt.show()

    figure, ax = setup(len(m))
    show(figure, ax, m)
Example #2
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from __future__ import division, print_function

import numpy as np

from plotting import setup, savefig, SQUARE_FIGSIZE

setup()
np.random.seed(42)


def log_prior(m, b, lns):
    if not -10.0 < lns < 5.0:
        return -np.inf
    return -1.5 * np.log(1 + b**2)


def log_likelihood(x, y, y_err, m, b, lns):
    mod = m * x + b
    var = np.sqrt(y_err**2 + np.exp(2 * lns))
    return -0.5 * np.sum((y - mod)**2 / var + np.log(var))


def log_posterior(theta, x, y, y_err):
    return log_prior(*theta) + log_likelihood(x, y, y_err, *theta)


if __name__ == "__main__":
    import emcee
import matplotlib.pyplot as plt
import argparse
import os
import sys
import numpy as np
import pandas as pd

sys.path.append("..")
import plotting

plotting.setup()

linestyles = [
    "solid", "dashed", (0, (3, 1, 1, 1)), "-.", (0, (1, 1)),
    (0, (3, 10, 1, 10))
]

parser = argparse.ArgumentParser(
    description='Plot average latency vs. steps for different approaches')

parser.add_argument('--folder',
                    default="./data_Load_change_QL_UCB_Softmax",
                    type=str,
                    help='Specify folder of measurements')
parser.add_argument('--save',
                    default=".",
                    type=str,
                    help='Specify save directory')
args = parser.parse_args()

folderpath = args.folder
Example #4
0
import matplotlib.pyplot as plt
from matplotlib import rcParams
import argparse
import os
import numpy as np
import pandas as pd
import sys

sys.path.append("..")
import plotting

plotting.setup(span=True)

linestyles = [
    "solid", "dashed", (0, (3, 1, 1, 1)), "-.", (0, (1, 1)),
    (0, (3, 10, 1, 10))
]
bar_colors = [
    "lightgreen", "salmon", "lightblue", "lightgray", "m", "gold", "darkgrey",
    "darkorchid", "cornflowerblue", "turquoise"
]
hatch_patterns = ('---', '\\\\', '+++', 'xxx', 'o', '*', 'O', '.', "ooo", "+")

prop_cycle = plt.rcParams['axes.prop_cycle']
colors = prop_cycle.by_key()['color']

parser = argparse.ArgumentParser(description='Plot average latency vs. load')

parser.add_argument('--folder',
                    default="./data_different_exploration_strategies",
                    type=str,