windows -.-

This commit is contained in:
Max Zwiessele 2014-01-10 10:00:38 +00:00
parent 4ad8f3c02f
commit 6f67ba5190
4 changed files with 19 additions and 12 deletions

View file

@ -4,8 +4,11 @@ import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning) warnings.filterwarnings("ignore", category=DeprecationWarning)
import os import os
with open("version", 'r') as f:
__version__ = f.read() def read(fname):
with open(os.path.join(os.path.dirname(__file__), fname)) as f:
return f.read()
__version__ = read('version')
import core import core
import models import models

View file

@ -126,7 +126,7 @@ class kern(Parameterized):
xi = patch.get_x() + patch.get_width() / 2. xi = patch.get_x() + patch.get_width() / 2.
va = 'top' va = 'top'
c = 'w' c = 'w'
t = TextPath((0, 0), "${xi}$".format(xi=xi), rotation=0, usetex=True, ha='center') t = TextPath((0, 0), "${xi}$".format(xi=xi), rotation=0, ha='center')
transform = transOffset transform = transOffset
if patch.get_extents().height <= t.get_extents().height + 3: if patch.get_extents().height <= t.get_extents().height + 3:
va = 'bottom' va = 'bottom'

View file

@ -2,9 +2,6 @@
# Licensed under the BSD 3-clause license (see LICENSE.txt) # Licensed under the BSD 3-clause license (see LICENSE.txt)
import matplotlib as mpl
import pylab as pb
import sys
#sys.path.append('/home/james/mlprojects/sitran_cluster/') #sys.path.append('/home/james/mlprojects/sitran_cluster/')
#from switch_pylab_backend import * #from switch_pylab_backend import *
@ -84,6 +81,7 @@ def reset():
lightList.append(lightList.pop(0)) lightList.append(lightList.pop(0))
def setLightFigures(): def setLightFigures():
import matplotlib as mpl
mpl.rcParams['axes.edgecolor']=colorsHex['Aluminium6'] mpl.rcParams['axes.edgecolor']=colorsHex['Aluminium6']
mpl.rcParams['axes.facecolor']=colorsHex['Aluminium2'] mpl.rcParams['axes.facecolor']=colorsHex['Aluminium2']
mpl.rcParams['axes.labelcolor']=colorsHex['Aluminium6'] mpl.rcParams['axes.labelcolor']=colorsHex['Aluminium6']
@ -97,6 +95,7 @@ def setLightFigures():
mpl.rcParams['ytick.color']=colorsHex['Aluminium6'] mpl.rcParams['ytick.color']=colorsHex['Aluminium6']
def setDarkFigures(): def setDarkFigures():
import matplotlib as mpl
mpl.rcParams['axes.edgecolor']=colorsHex['Aluminium2'] mpl.rcParams['axes.edgecolor']=colorsHex['Aluminium2']
mpl.rcParams['axes.facecolor']=colorsHex['Aluminium6'] mpl.rcParams['axes.facecolor']=colorsHex['Aluminium6']
mpl.rcParams['axes.labelcolor']=colorsHex['Aluminium2'] mpl.rcParams['axes.labelcolor']=colorsHex['Aluminium2']
@ -157,10 +156,10 @@ cdict_Alu = {'red' :((0./5,colorsRGB['Aluminium1'][0]/256.,colorsRGB['Aluminium1
(5./5,colorsRGB['Aluminium6'][2]/256.,colorsRGB['Aluminium6'][2]/256.))} (5./5,colorsRGB['Aluminium6'][2]/256.,colorsRGB['Aluminium6'][2]/256.))}
# cmap_Alu = mpl.colors.LinearSegmentedColormap('TangoAluminium',cdict_Alu,256) # cmap_Alu = mpl.colors.LinearSegmentedColormap('TangoAluminium',cdict_Alu,256)
# cmap_BGR = mpl.colors.LinearSegmentedColormap('TangoRedBlue',cdict_BGR,256) # cmap_BGR = mpl.colors.LinearSegmentedColormap('TangoRedBlue',cdict_BGR,256)
# cmap_RB = mpl.colors.LinearSegmentedColormap('TangoRedBlue',cdict_RB,256)
if __name__=='__main__': if __name__=='__main__':
import pylab as pb import matplotlib.pyplot as pb, numpy as np
pb.figure() pb.figure()
pb.pcolor(pb.rand(10,10),cmap=cmap_RB) cmap_RB = mpl.colors.LinearSegmentedColormap('TangoRedBlue',cdict_RB,256)
pb.pcolor(np.random.rand(10,10),cmap=cmap_RB)
pb.colorbar() pb.colorbar()
pb.show() pb.show()

View file

@ -1,7 +1,7 @@
import pylab as pb import pylab as pb
import numpy as np import numpy as np
from .. import util from .. import util
from GPy.util.latent_space_visualizations.controllers.imshow_controller import ImshowController from .latent_space_visualizations.controllers.imshow_controller import ImshowController
import itertools import itertools
def most_significant_input_dimensions(model, which_indices): def most_significant_input_dimensions(model, which_indices):
@ -40,15 +40,20 @@ def plot_latent(model, labels=None, which_indices=None,
# first, plot the output variance as a function of the latent space # first, plot the output variance as a function of the latent space
Xtest, xx, yy, xmin, xmax = util.plot.x_frame2D(model.X[:, [input_1, input_2]], resolution=resolution) Xtest, xx, yy, xmin, xmax = util.plot.x_frame2D(model.X[:, [input_1, input_2]], resolution=resolution)
Xtest_full = np.zeros((Xtest.shape[0], model.X.shape[1])) #Xtest_full = np.zeros((Xtest.shape[0], model.X.shape[1]))
def plot_function(x): def plot_function(x):
Xtest_full = np.zeros((Xtest.shape[0], model.X.shape[1]))
Xtest_full[:, [input_1, input_2]] = x Xtest_full[:, [input_1, input_2]] = x
mu, var, low, up = model.predict(Xtest_full) mu, var, low, up = model.predict(Xtest_full)
var = var[:, :1] var = var[:, :1]
return np.log(var) return np.log(var)
xmi, ymi = xmin
xma, yma = xmax
view = ImshowController(ax, plot_function, view = ImshowController(ax, plot_function,
tuple(model.X[:, [input_1, input_2]].min(0)) + tuple(model.X[:, [input_1, input_2]].max(0)), (xmi, ymi, xma, yma),
resolution, aspect=aspect, interpolation='bilinear', resolution, aspect=aspect, interpolation='bilinear',
cmap=pb.cm.binary) cmap=pb.cm.binary)