Package dimer :: Module data :: Class aAnchorDataset
[hide private]
[frames] | no frames]

Class aAnchorDataset

source code

object --+
         |
        aAnchorDataset

this dataset contains various tracks of epigenetic signal in the for a set of genome sites (e.g., TSS-cenetered regions) all of the same width. an instance maintains references to X (as a panel and ndarray), Y, and T

Instance Methods [hide private]
 
__init__(self, X, Y, T, batch_size, valid_s=None, valid_idx=None, rng=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
__sh_anon(self, what, shape=None, borrow=True) source code
 
share(self, which, shape=None, borrow=True)
wrap the data on a thean.shared variable
source code
 
__iter_batches(self, which, nepochs)
infinite loop over train/valid batches
source code
 
iter_train(self, nepochs) source code
 
iter_valid(self, nepochs) source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]
 
__batches(tot_size, batch_s, valid_s, valid_idx, rng)
create train and validation batches from the given params.
source code
 
normalize_features(x)
transform each component of flattened X examples to 0 mean and 1 std So the values of track t at position i are 0 mean and 1 std
source code
 
fit_features(x)
transform each **component** of X so that it fits on an interval [-1, 1].
source code
Properties [hide private]
  shX
  shY
  shT
  labels
  tracks
  width

Inherited from object: __class__

Method Details [hide private]

__init__(self, X, Y, T, batch_size, valid_s=None, valid_idx=None, rng=None)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

share(self, which, shape=None, borrow=True)

source code 

wrap the data on a thean.shared variable

Parameters:
  • which - what component to wrap (str, typically 'X', 'T', 'Y')
  • shape - reshape the array to this shape
  • borrow - passer to theano.share
Returns:
theano.shared instance initialized to the required data

__iter_batches(self, which, nepochs)

source code 

infinite loop over train/valid batches

Parameters:
  • nepochs - loop this many times over train batches (0 will loop forever)
Returns:
iterator

__batches(tot_size, batch_s, valid_s, valid_idx, rng)
Static Method

source code 

create train and validation batches from the given params.

the idea is to split the data into batches and allocate a 'valid_s' portion of them for validation. the position of the (continuous) validation block is w.r.t batches. E.g., for tot_size = 10, batch_s = 2, valid_idx=3, valid_s = 0.3 you get 4 + 1 train + valid batches: T T T V T

Parameters:
  • tot_size - nr. of examples
  • batch_s - batch size
  • valid_s - fraction of data to allocate for validation
  • valid_idx - batch index at which allocate validation data
  • rng - numpy.RandomState used to shuffle batches or None (no shuffle) @return : (train_batches, valid_batches)

normalize_features(x)
Static Method

source code 
transform each component of flattened X examples to 0 mean and 1 std
So the values of track t at position i are 0 mean and 1 std

x: a pandas data panel of the form <anchors> X <tracks> X <genome position>
return: (the shifted input,
        the mean for each input component, the sd of each input component)
        the latter 2 are arrays of shape(<tracks>, <genome position>)

fit_features(x)
Static Method

source code 

transform each **component** of X so that it fits on an interval [-1, 1]. So the values of track t at position i are all in [-1,1]

Parameters:
  • x - a pandas data panel of the form <anchors> X <tracks> X <genome position>
Returns:
the scaled input

Property Details [hide private]

shX

Get Method:
unreachable.shX(self)

shY

Get Method:
unreachable.shY(self)

shT

Get Method:
unreachable.shT(self)

labels

Get Method:
unreachable.labels(self)

tracks

Get Method:
unreachable.tracks(self)

width

Get Method:
unreachable.width(self)