Exemplo n.º 1
0
 def __init__(self, path, keys, train_frac=0.6, val_frac=0.2):
     self._path = path
     self._files = glob(path)
     self._idx = {'train': 0, 'val': 0, 'test': 0}
     self.keys = keys
     self._fracs = {
         'train': (0, train_frac),
         'val': (train_frac, train_frac + val_frac),
         'test': (train_frac + val_frac, 1)
     }
     self.plotter = utils.Plotter()
Exemplo n.º 2
0
def plot(binning, fn, samples, outpath, xlabel=None, ylabel=None):
    hists = {}
    for s in samples:
        h = utils.NH1(binning)
        if type(fn) == int:
            h.fill_array(s.X[s.vidx, fn], weights=s.W[s.vidx])
        else:
            h.fill_array(fn(s), weights=s.W[s.vidx])
        h.scale()
        hists[s.name] = h

    p = utils.Plotter()
    for i, s in enumerate(samples):
        p.add_hist(hists[s.name], s.name, i)

    _make_parent(outpath)

    p.plot(xlabel=xlabel, ylabel=ylabel, output=outpath)
    p.plot(xlabel=xlabel, ylabel=ylabel, output=outpath + '_logy', logy=True)
    p.clear()
    return hists
Exemplo n.º 3
0
 def __init__(self, n_input=1):
     self.n_input = n_input
     self.plotter = utils.Plotter()
     self.roc = utils.Roccer()
Exemplo n.º 4
0
environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
environ["CUDA_VISIBLE_DEVICES"] = ""

import numpy as np

import extra_vars
from subtlenet import config, utils
from subtlenet.backend import obj
from subtlenet.generators.gen import make_coll
basedir = environ['BASEDIR']
figsdir = environ['FIGSDIR']

n_batches = 500
partition = 'test'

p = utils.Plotter()
r1 = utils.Roccer(y_range=range(-5, 1))
r2 = utils.Roccer(y_range=range(-4, 1))

OUTPUT = figsdir + '/'
system('mkdir -p %s' % OUTPUT)

components = [
    'singletons',
    'shallow',
    'baseline2_7_100',
    'kltest_7_100',
    'categorical_crossentropy2_7_100',
    'categorical_crossentropytest2_7_100',
    'categorical_crossentropytesttest2_7_100',
]
Exemplo n.º 5
0
 def __init__(self, n_input=2, n_output=1):
     self.n_input = n_input
     self.n_output = n_output
     self.plotter = utils.Plotter()
     self.roc = utils.Roccer(y_range=range(-1,1))