mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-21 14:05:14 +02:00
windows -.-
This commit is contained in:
parent
4ad8f3c02f
commit
6f67ba5190
4 changed files with 19 additions and 12 deletions
|
|
@ -4,8 +4,11 @@ import warnings
|
|||
warnings.filterwarnings("ignore", category=DeprecationWarning)
|
||||
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 models
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ class kern(Parameterized):
|
|||
xi = patch.get_x() + patch.get_width() / 2.
|
||||
va = 'top'
|
||||
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
|
||||
if patch.get_extents().height <= t.get_extents().height + 3:
|
||||
va = 'bottom'
|
||||
|
|
|
|||
|
|
@ -2,9 +2,6 @@
|
|||
# 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/')
|
||||
#from switch_pylab_backend import *
|
||||
|
||||
|
|
@ -84,6 +81,7 @@ def reset():
|
|||
lightList.append(lightList.pop(0))
|
||||
|
||||
def setLightFigures():
|
||||
import matplotlib as mpl
|
||||
mpl.rcParams['axes.edgecolor']=colorsHex['Aluminium6']
|
||||
mpl.rcParams['axes.facecolor']=colorsHex['Aluminium2']
|
||||
mpl.rcParams['axes.labelcolor']=colorsHex['Aluminium6']
|
||||
|
|
@ -97,6 +95,7 @@ def setLightFigures():
|
|||
mpl.rcParams['ytick.color']=colorsHex['Aluminium6']
|
||||
|
||||
def setDarkFigures():
|
||||
import matplotlib as mpl
|
||||
mpl.rcParams['axes.edgecolor']=colorsHex['Aluminium2']
|
||||
mpl.rcParams['axes.facecolor']=colorsHex['Aluminium6']
|
||||
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.))}
|
||||
# cmap_Alu = mpl.colors.LinearSegmentedColormap('TangoAluminium',cdict_Alu,256)
|
||||
# cmap_BGR = mpl.colors.LinearSegmentedColormap('TangoRedBlue',cdict_BGR,256)
|
||||
# cmap_RB = mpl.colors.LinearSegmentedColormap('TangoRedBlue',cdict_RB,256)
|
||||
if __name__=='__main__':
|
||||
import pylab as pb
|
||||
import matplotlib.pyplot as pb, numpy as np
|
||||
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.show()
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import pylab as pb
|
||||
import numpy as np
|
||||
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
|
||||
|
||||
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
|
||||
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):
|
||||
Xtest_full = np.zeros((Xtest.shape[0], model.X.shape[1]))
|
||||
Xtest_full[:, [input_1, input_2]] = x
|
||||
mu, var, low, up = model.predict(Xtest_full)
|
||||
var = var[:, :1]
|
||||
return np.log(var)
|
||||
|
||||
xmi, ymi = xmin
|
||||
xma, yma = xmax
|
||||
|
||||
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',
|
||||
cmap=pb.cm.binary)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue