index
int64
0
731k
package
stringlengths
2
98
name
stringlengths
1
76
docstring
stringlengths
0
281k
code
stringlengths
4
8.19k
signature
stringlengths
2
42.8k
embed_func_code
listlengths
768
768
722,367
paramz.parameterized
copy
null
def copy(self, memo=None): if memo is None: memo = {} memo[id(self.optimizer_array)] = None # and param_array memo[id(self.param_array)] = None # and param_array copy = super(Parameterized, self).copy(memo) copy._connect_parameters() copy._connect_fixes() copy._notify_parent_change()...
(self, memo=None)
[ -0.006168125197291374, -0.039837151765823364, 0.047281280159950256, 0.022406093776226044, -0.12139090895652771, 0.015210716053843498, -0.03206135332584381, 0.028984198346734047, 0.043669771403074265, 0.007190771400928497, -0.012124350294470787, 0.025851767510175705, -0.03788398951292038, 0...
722,368
paramz.core.parameter_core
disable_caching
null
def disable_caching(self): def visit(self): self.cache.disable_caching() self.traverse(visit)
(self)
[ 0.031239710748195648, -0.00030667666578665376, -0.03358227014541626, 0.03145723417401314, -0.024345891550183296, 0.010215234942734241, -0.06505624204874039, 0.016314256936311722, 0.013168534263968468, -0.013109969906508923, 0.007918689399957657, 0.016289157792925835, -0.012959376908838749, ...
722,369
paramz.core.parameter_core
enable_caching
null
def enable_caching(self): def visit(self): self.cache.enable_caching() self.traverse(visit)
(self)
[ 0.022566696628928185, -0.022732142359018326, -0.04453779011964798, 0.04496794939041138, 0.020134655758738518, 0.034180935472249985, -0.04099727049469948, 0.01281371433287859, -0.0003934488631784916, -0.014120729640126228, 0.028605438768863678, -0.006506124045699835, 0.017404813319444656, 0...
722,371
paramz.parameterized
get_property_string
null
def get_property_string(self, propname): props = [] for p in self.parameters: props.extend(p.get_property_string(propname)) return props
(self, propname)
[ 0.007221184205263853, -0.03161707893013954, 0.029044419527053833, -0.02876054123044014, 0.019144123420119286, -0.001370605663396418, 0.002510559279471636, -0.05237576365470886, 0.10517735034227371, 0.012535053305327892, 0.015356105752289295, 0.02098933979868889, -0.029204102233052254, 0.00...
722,372
paramz.parameterized
grep_param_names
create a list of parameters, matching regular expression regexp
def grep_param_names(self, regexp): """ create a list of parameters, matching regular expression regexp """ if not isinstance(regexp, _pattern_type): regexp = compile(regexp) found_params = [] def visit(innerself, regexp): if (innerself is not self) and regexp.match(innerself.hierarchy_n...
(self, regexp)
[ 0.03582914546132088, -0.03892243653535843, 0.051012784242630005, 0.019797060638666153, -0.02653159573674202, -0.013433719985187054, 0.057234715670347214, -0.05960329249501228, -0.0017819564091041684, 0.006244028452783823, 0.0002079685655189678, 0.00909427460283041, 0.008418169803917408, -0...
722,373
paramz.core.parentable
has_parent
Return whether this parentable object currently has a parent.
def has_parent(self): """ Return whether this parentable object currently has a parent. """ return self._parent_ is not None
(self)
[ 0.020805176347494125, 0.019000645726919174, -0.00912880152463913, 0.04897000640630722, -0.0032463858369737864, 0.023335058242082596, 0.04153958708047867, 0.07536569237709045, 0.04387486353516579, 0.0038810677360743284, 0.007041207514703274, -0.0723935216665268, 0.03559524938464165, -0.0006...
722,374
paramz.core.nameable
hierarchy_name
return the name for this object with the parents names attached by dots. :param bool adjust_for_printing: whether to call :func:`~adjust_for_printing()` on the names, recursively
def hierarchy_name(self, adjust_for_printing=True): """ return the name for this object with the parents names attached by dots. :param bool adjust_for_printing: whether to call :func:`~adjust_for_printing()` on the names, recursively ...
(self, adjust_for_printing=True)
[ -0.008669245056807995, 0.011320754885673523, 0.042071208357810974, 0.04934190213680267, -0.0338122621178627, -0.021247372031211853, 0.010808982886373997, -0.024070942774415016, 0.07588347047567368, -0.029541611671447754, 0.007111869286745787, -0.06310681253671646, 0.018723804503679276, -0....
722,375
paramz.core.parameter_core
initialize_parameter
Call this function to initialize the model, if you built it without initialization. This HAS to be called manually before optmizing or it will be causing unexpected behaviour, if not errors!
def initialize_parameter(self): """ Call this function to initialize the model, if you built it without initialization. This HAS to be called manually before optmizing or it will be causing unexpected behaviour, if not errors! """ #logger.debug("connecting parameters") self._highest_parent_....
(self)
[ 0.013582386076450348, 0.012266537174582481, 0.028789712116122246, 0.04934874549508095, -0.04168326407670975, -0.024356450885534286, -0.01843954622745514, 0.028878025710582733, 0.02875438891351223, -0.020382409915328026, -0.04090612009167671, -0.004389106761664152, 0.0049763815477490425, 0....
722,376
paramz.parameterized
link_parameter
:param parameters: the parameters to add :type parameters: list of or one :py:class:`paramz.param.Param` :param [index]: index of where to put parameters Add all parameters to this param class, you can insert parameters at any given index using the :func:`list.insert` sy...
def link_parameter(self, param, index=None): """ :param parameters: the parameters to add :type parameters: list of or one :py:class:`paramz.param.Param` :param [index]: index of where to put parameters Add all parameters to this param class, you can insert parameters at any given index u...
(self, param, index=None)
[ 0.00606866180896759, 0.007127036340534687, -0.02759541943669319, 0.05651137977838516, -0.034062184393405914, 0.01648733951151371, -0.060706038028001785, -0.0018290946027264, 0.021750083193182945, -0.013302506878972054, -0.01668153703212738, -0.03668384626507759, 0.0008490057662129402, -0.0...
722,377
paramz.parameterized
link_parameters
convenience method for adding several parameters without gradient specification
def link_parameters(self, *parameters): """ convenience method for adding several parameters without gradient specification """ [self.link_parameter(p) for p in parameters]
(self, *parameters)
[ -0.02483977936208248, -0.0019909145776182413, 0.010783090256154537, 0.01155652292072773, -0.06989672780036926, 0.016745716333389282, -0.08856703341007233, -0.014758174307644367, 0.061658769845962524, 0.05151421204209328, -0.03007393889129162, -0.029030704870820045, 0.006268401630222797, 0....
722,378
paramz.core.observable
notify_observers
Notifies all observers. Which is the element, which kicked off this notification loop. The first argument will be self, the second `which`. .. note:: notifies only observers with priority p > min_priority! :param min_priority: only notify observers wi...
def notify_observers(self, which=None, min_priority=None): """ Notifies all observers. Which is the element, which kicked off this notification loop. The first argument will be self, the second `which`. .. note:: notifies only observers with priority p > min_priority! :param m...
(self, which=None, min_priority=None)
[ 0.03817036375403404, 0.024871185421943665, -0.01910245232284069, -0.03348974138498306, 0.0008274203282780945, -0.06608135998249054, -0.004216443281620741, 0.017133483663201332, 0.0048749251291155815, 0.04190104082226753, -0.011451108381152153, -0.030380845069885254, 0.04355911910533905, -0...
722,379
paramz.model
objective_function
The objective function for the given algorithm. This function is the true objective, which wants to be minimized. Note that all parameters are already set and in place, so you just need to return the objective function here. For probabilistic models this is the negative log_li...
def objective_function(self): """ The objective function for the given algorithm. This function is the true objective, which wants to be minimized. Note that all parameters are already set and in place, so you just need to return the objective function here. For probabilistic models this is the ...
(self)
[ 0.03691192343831062, -0.01894022896885872, -0.005048934370279312, 0.03108278289437294, -0.013039343990385532, -0.0665060356259346, -0.054309673607349396, -0.05172691494226456, 0.03404219448566437, -0.02195344865322113, -0.04702772945165634, -0.02803369238972664, 0.013129022903740406, 0.036...
722,380
paramz.model
objective_function_gradients
The gradients for the objective function for the given algorithm. The gradients are w.r.t. the *negative* objective function, as this framework works with *negative* log-likelihoods as a default. You can find the gradient for the parameters in self.gradient at all times. This i...
def objective_function_gradients(self): """ The gradients for the objective function for the given algorithm. The gradients are w.r.t. the *negative* objective function, as this framework works with *negative* log-likelihoods as a default. You can find the gradient for the parameters in self.gradien...
(self)
[ 0.02462603710591793, -0.019650166854262352, 0.002795534674078226, 0.031085623428225517, -0.025657400488853455, -0.04603132978081703, -0.057575348764657974, -0.0644872859120369, 0.0246079433709383, -0.0024969824589788914, -0.03716523200273514, -0.016592267900705338, 0.024517472833395004, 0....
722,381
paramz.model
optimize
Optimize the model using self.log_likelihood and self.log_likelihood_gradient, as well as self.priors. kwargs are passed to the optimizer. They can be: :param max_iters: maximum number of function evaluations :type max_iters: int :messages: True: Display messages during optimi...
def optimize(self, optimizer=None, start=None, messages=False, max_iters=1000, ipython_notebook=True, clear_after_finish=False, **kwargs): """ Optimize the model using self.log_likelihood and self.log_likelihood_gradient, as well as self.priors. kwargs are passed to the optimizer. They can be: :param ma...
(self, optimizer=None, start=None, messages=False, max_iters=1000, ipython_notebook=True, clear_after_finish=False, **kwargs)
[ -0.004613934550434351, -0.03393232822418213, 0.016497744247317314, 0.013574805110692978, -0.038860104978084564, -0.02600666508078575, -0.07479726523160934, -0.07543431967496872, -0.019523736089468002, -0.03458811342716217, -0.020104575902223587, -0.017340900376439095, -0.007110612001270056, ...
722,382
paramz.model
optimize_restarts
Perform random restarts of the model, and set the model to the best seen solution. If the robust flag is set, exceptions raised during optimizations will be handled silently. If _all_ runs fail, the model is reset to the existing parameter values. \*\*kwargs are passe...
def optimize_restarts(self, num_restarts=10, robust=False, verbose=True, parallel=False, num_processes=None, **kwargs): """ Perform random restarts of the model, and set the model to the best seen solution. If the robust flag is set, exceptions raised during optimizations will be handled silently. ...
(self, num_restarts=10, robust=False, verbose=True, parallel=False, num_processes=None, **kwargs)
[ 0.05332554131746292, 0.006919534411281347, -0.02051416225731373, 0.05949295312166214, -0.016960380598902702, -0.020100494846701622, -0.0899539440870285, -0.054416120052337646, 0.060583531856536865, -0.02015690505504608, -0.0011898825177922845, 0.01702619157731533, 0.03141995146870613, 0.01...
722,383
paramz.core.parameter_core
parameter_names
Get the names of all parameters of this model or parameter. It starts from the parameterized object you are calling this method on. Note: This does not unravel multidimensional parameters, use parameter_names_flat to unravel parameters! :param bool add_self: whether to a...
def parameter_names(self, add_self=False, adjust_for_printing=False, recursive=True, intermediate=False): """ Get the names of all parameters of this model or parameter. It starts from the parameterized object you are calling this method on. Note: This does not unravel multidimensional parameters, ...
(self, add_self=False, adjust_for_printing=False, recursive=True, intermediate=False)
[ -0.011619329452514648, -0.023946711793541908, 0.02982899732887745, 0.026615526527166367, -0.04143017157912254, -0.016530310735106468, -0.01059356052428484, -0.06107410043478012, 0.07345594465732574, -0.006649342831224203, 0.00370139186270535, -0.03249781206250191, 0.013198832049965858, -0....
722,384
paramz.core.parameter_core
parameter_names_flat
Return the flattened parameter names for all subsequent parameters of this parameter. We do not include the name for self here! If you want the names for fixed parameters as well in this list, set include_fixed to True. if not hasattr(obj, 'cache'): obj.cach...
def parameter_names_flat(self, include_fixed=False): """ Return the flattened parameter names for all subsequent parameters of this parameter. We do not include the name for self here! If you want the names for fixed parameters as well in this list, set include_fixed to True. if not hasattr(...
(self, include_fixed=False)
[ -0.009617718867957592, -0.022739289328455925, 0.03843512013554573, 0.015847783535718918, -0.024294571951031685, -0.04311884194612503, 0.010225529782474041, -0.051985736936330795, 0.05194998160004616, 0.008808793500065804, -0.022292369976639748, -0.050841622054576874, -0.018788516521453857, ...
722,385
paramz.core.parameter_core
parameters_changed
This method gets called when parameters have changed. Another way of listening to param changes is to add self as a listener to the param, such that updates get passed through. See :py:function:``paramz.param.Observable.add_observer``
def parameters_changed(self): """ This method gets called when parameters have changed. Another way of listening to param changes is to add self as a listener to the param, such that updates get passed through. See :py:function:``paramz.param.Observable.add_observer`` """ pass
(self)
[ 0.02402462251484394, 0.0058966344222426414, 0.011276327073574066, 0.03217301890254021, 0.0036426829174160957, 0.0029132701456546783, -0.06101658195257187, 0.029211558401584625, 0.016340598464012146, 0.02008185163140297, -0.00501170102506876, -0.03704453259706497, 0.04983663558959961, 0.026...
722,386
paramz.core.pickleable
pickle
:param f: either filename or open file object to write to. if it is an open buffer, you have to make sure to close it properly. :param protocol: pickling protocol to use, python-pickle for details.
def pickle(self, f, protocol=-1): """ :param f: either filename or open file object to write to. if it is an open buffer, you have to make sure to close it properly. :param protocol: pickling protocol to use, python-pickle for details. """ try: #Py2 import cPickle...
(self, f, protocol=-1)
[ 0.043797023594379425, -0.02451431378722191, -0.04998304322361946, 0.05005374178290367, -0.02709476836025715, -0.051997918635606766, -0.08646288514137268, 0.05631045997142792, -0.010648791678249836, -0.03359892591834068, -0.0016735394019633532, -0.010321816429495811, -0.06613739579916, 0.01...
722,387
paramz.core.parameter_core
randomize
Randomize the model. Make this draw from the rand_gen if one exists, else draw random normal(0,1) :param rand_gen: np random number generator which takes args and kwargs :param flaot loc: loc parameter for random number generator :param float scale: scale parameter for random n...
def randomize(self, rand_gen=None, *args, **kwargs): """ Randomize the model. Make this draw from the rand_gen if one exists, else draw random normal(0,1) :param rand_gen: np random number generator which takes args and kwargs :param flaot loc: loc parameter for random number generator :param fl...
(self, rand_gen=None, *args, **kwargs)
[ 0.00046789253246970475, -0.045028865337371826, 0.0029996081721037626, 0.014472240582108498, -0.00522093940526247, 0.0072778137400746346, -0.05388639494776726, -0.03872853145003319, 0.028981542214751244, -0.010812487453222275, -0.03202052786946297, 0.053960517048835754, -0.0037802010774612427...
722,388
paramz.core.indexable
remove_index_operation
null
def remove_index_operation(self, name): if name in self._index_operations: delitem(self._index_operations, name) #delattr(self, name) else: raise AttributeError("No index operation with the name {}".format(name))
(self, name)
[ 0.021173547953367233, -0.02152208238840103, 0.028318529948592186, 0.00538923405110836, -0.018977772444486618, -0.01061291340738535, -0.04774940013885498, -0.002531240927055478, 0.013070090673863888, -0.02244570292532444, 0.024990012869238853, 0.01577124372124672, 0.05524291843175888, -0.07...
722,389
paramz.core.observable
remove_observer
Either (if callble is None) remove all callables, which were added alongside observer, or remove callable `callble` which was added alongside the observer `observer`.
def remove_observer(self, observer, callble=None): """ Either (if callble is None) remove all callables, which were added alongside observer, or remove callable `callble` which was added alongside the observer `observer`. """ to_remove = [] for poc in self.observers: _, obs, clbl...
(self, observer, callble=None)
[ -0.02270221896469593, 0.017552178353071213, -0.02408607304096222, 0.007913369685411453, -0.08015845715999603, -0.04512416571378708, -0.023122631013393402, 0.053182050585746765, 0.02958645671606064, 0.042041145265102386, -0.001954256324097514, -0.004009236581623554, 0.009135191328823566, -0...
722,390
paramz.core.parameter_core
save
Save all the model parameters into a file (HDF5 by default). This is not supported yet. We are working on having a consistent, human readable way of saving and loading GPy models. This only saves the parameter array to a hdf5 file. In order to load the model again, use the same...
def save(self, filename, ftype='HDF5'): # pragma: no coverage """ Save all the model parameters into a file (HDF5 by default). This is not supported yet. We are working on having a consistent, human readable way of saving and loading GPy models. This only saves the parameter array to a hdf5 file. In...
(self, filename, ftype='HDF5')
[ 0.02926906943321228, -0.020168447867035866, -0.055633291602134705, 0.03849838674068451, 0.0035414285957813263, -0.031309813261032104, -0.08685117959976196, -0.022319503128528595, -0.027081243693828583, -0.042653415352106094, -0.015526211820542812, -0.028772670775651932, -0.029342608526349068...
722,391
paramz.core.observable
set_updates
null
def set_updates(self, on=True): self._update_on = on
(self, on=True)
[ 0.02885134331882, 0.02670932561159134, -0.01983838900923729, 0.025539454072713852, 0.02226051688194275, -0.00080016755964607, -0.03364617004990578, 0.026017287746071815, 0.007414679974317551, 0.040961988270282745, -0.06887413561344147, -0.06511736661195755, 0.06702870875597, 0.039874501526...
722,392
paramz.core.updateable
toggle_update
null
def toggle_update(self): print("deprecated: toggle_update was renamed to update_toggle for easier access") self.update_toggle()
(self)
[ 0.04985593631863594, -0.033888090401887894, 0.02956491895020008, -0.011993316002190113, -0.015392584726214409, -0.03887368366122246, -0.004846136551350355, 0.06415029615163803, -0.00536474259570241, 0.009361062198877335, -0.06871751695871353, -0.08918285369873047, 0.059025246649980545, 0.0...
722,393
paramz.core.parameter_core
traverse
Traverse the hierarchy performing `visit(self, *args, **kwargs)` at every node passed by downwards. This function includes self! See *visitor pattern* in literature. This is implemented in pre-order fashion. Example:: #Collect all children: children = [] ...
def traverse(self, visit, *args, **kwargs): """ Traverse the hierarchy performing `visit(self, *args, **kwargs)` at every node passed by downwards. This function includes self! See *visitor pattern* in literature. This is implemented in pre-order fashion. Example:: #Collect all children: ...
(self, visit, *args, **kwargs)
[ -0.054509446024894714, -0.04716109111905098, -0.05641051381826401, 0.03215362876653671, -0.05162128806114197, 0.03341491147875786, -0.01078490074723959, -0.0010944845853373408, 0.024384843185544014, 0.014916066080331802, 0.00685023982077837, -0.023763339966535568, 0.0699373409152031, 0.016...
722,394
paramz.core.parameter_core
traverse_parents
Traverse the hierarchy upwards, visiting all parents and their children except self. See "visitor pattern" in literature. This is implemented in pre-order fashion. Example: parents = [] self.traverse_parents(parents.append) print parents
def traverse_parents(self, visit, *args, **kwargs): """ Traverse the hierarchy upwards, visiting all parents and their children except self. See "visitor pattern" in literature. This is implemented in pre-order fashion. Example: parents = [] self.traverse_parents(parents.append) print parent...
(self, visit, *args, **kwargs)
[ -0.05224006995558739, -0.03590364009141922, -0.041069239377975464, 0.041799359023571014, -0.07235486805438995, 0.0462895929813385, 0.015989623963832855, 0.01629992388188839, 0.06567427515983582, 0.021264739334583282, 0.02168455719947815, -0.06753607839345932, 0.05983331426978111, 0.0237471...
722,395
paramz.core.updateable
trigger_update
Update the model from the current state. Make sure that updates are on, otherwise this method will do nothing :param bool trigger_parent: Whether to trigger the parent, after self has updated
def trigger_update(self, trigger_parent=True): """ Update the model from the current state. Make sure that updates are on, otherwise this method will do nothing :param bool trigger_parent: Whether to trigger the parent, after self has updated """ if not self.update_model() or (hasattr(self, ...
(self, trigger_parent=True)
[ 0.06881824135780334, -0.02197187766432762, 0.008549505844712257, 0.05812256783246994, -0.035165559500455856, -0.05970580875873566, 0.00042659571045078337, 0.04112910479307175, 0.05822811648249626, 0.020933974534273148, -0.06434998661279678, -0.05784109979867935, 0.04067172482609749, 0.0343...
722,396
paramz.core.constrainable
unconstrain
:param transforms: The transformations to unconstrain from. remove all :py:class:`paramz.transformations.Transformation` transformats of this parameter object.
def unconstrain(self, *transforms): """ :param transforms: The transformations to unconstrain from. remove all :py:class:`paramz.transformations.Transformation` transformats of this parameter object. """ return self._remove_from_index_operations(self.constraints, transforms)
(self, *transforms)
[ 0.029548421502113342, 0.010629802010953426, 0.035652320832014084, -0.004495556466281414, -0.10439055413007736, -0.024831771850585938, -0.029617784544825554, -0.05677320063114166, 0.027692975476384163, 0.022594831883907318, -0.04844970256090164, 0.02651381306350231, -0.010204956866800785, -...
722,397
paramz.core.constrainable
unconstrain_bounded
:param lower, upper: the limits to unbound this parameter from Remove (lower, upper) bounded constrain from this parameter/
def unconstrain_bounded(self, lower, upper): """ :param lower, upper: the limits to unbound this parameter from Remove (lower, upper) bounded constrain from this parameter/ """ self.unconstrain(Logistic(lower, upper))
(self, lower, upper)
[ -0.023779820650815964, 0.04499977454543114, 0.017599089071154594, 0.03287408873438835, -0.06318830698728561, -0.056653909385204315, -0.03671388700604439, -0.07490980625152588, 0.004989215172827244, -0.018441149964928627, -0.027737511321902275, 0.015216054394841194, -0.01731278747320175, -0...
722,398
paramz.core.constrainable
unconstrain_fixed
This parameter will no longer be fixed. If there was a constraint on this parameter when fixing it, it will be constraint with that previous constraint.
def unconstrain_fixed(self): """ This parameter will no longer be fixed. If there was a constraint on this parameter when fixing it, it will be constraint with that previous constraint. """ unconstrained = self.unconstrain(__fixed__) self._highest_parent_._set_unfixed(self, unconstrained) ...
(self)
[ 0.056954722851514816, 0.05751928687095642, 0.029689516872167587, 0.03410641476511955, -0.07797649502754211, -0.03530196473002434, -0.011166778393089771, -0.03530196473002434, 0.06459296494722366, -0.04905080050230026, -0.025006942451000214, -0.02668403461575508, -0.0244755856692791, -0.051...
722,399
paramz.core.constrainable
unconstrain_negative
Remove negative constraint of this parameter.
def unconstrain_negative(self): """ Remove negative constraint of this parameter. """ self.unconstrain(NegativeLogexp())
(self)
[ 0.024126533418893814, 0.017461290583014488, 0.06207727640867233, 0.058259159326553345, -0.05144580081105232, -0.04413871839642525, -0.02761550061404705, -0.0542764738202095, 0.04440203681588173, -0.05365109071135521, -0.031548816710710526, -0.0030281597282737494, 0.012227840721607208, -0.0...
722,400
paramz.core.constrainable
unconstrain_positive
Remove positive constraint of this parameter.
def unconstrain_positive(self): """ Remove positive constraint of this parameter. """ self.unconstrain(Logexp())
(self)
[ 0.009255959652364254, 0.023798702284693718, 0.059676799923181534, 0.06671492755413055, -0.03911891207098961, -0.035648949444293976, -0.019248468801379204, -0.05790908262133598, 0.04648439586162567, -0.0474664606153965, -0.032359033823013306, -0.008863134309649467, 0.015655748546123505, -0....
722,402
paramz.parameterized
unlink_parameter
:param param: param object to remove from being a parameter of this parameterized object.
def unlink_parameter(self, param): """ :param param: param object to remove from being a parameter of this parameterized object. """ if not param in self.parameters: try: raise HierarchyError("{} does not belong to this object {}, remove parameters directly from their respective pare...
(self, param)
[ 0.024013563990592957, 0.03386710211634636, -0.005586919840425253, 0.032998714596033096, -0.05327289551496506, -0.03379621356725693, -0.055328670889139175, 0.012538447976112366, 0.022542623803019524, 0.016490496695041656, -0.008099040016531944, -0.026069339364767075, 0.0044792830012738705, ...
722,403
paramz.core.updateable
update_model
Get or set, whether automatic updates are performed. When updates are off, the model might be in a non-working state. To make the model work turn updates on again. :param bool|None updates: bool: whether to do updates None: get the current update state
def update_model(self, updates=None): """ Get or set, whether automatic updates are performed. When updates are off, the model might be in a non-working state. To make the model work turn updates on again. :param bool|None updates: bool: whether to do updates None: get the current up...
(self, updates=None)
[ 0.053432855755090714, -0.0010627887677401304, -0.017828870564699173, 0.02589217759668827, 0.015508429147303104, -0.04751976206898689, -0.018599364906549454, 0.037951305508613586, 0.026393895968794823, 0.02275644801557064, -0.05547555908560753, -0.06902191787958145, 0.07382406294345856, 0.0...
722,404
paramz.core.updateable
update_toggle
null
def update_toggle(self): self.update_model(not self.update_model())
(self)
[ 0.040589239448308945, -0.004392371512949467, 0.02589721977710724, 0.03021342307329178, -0.025169389322400093, -0.0465472936630249, -0.01096823439002037, 0.055992159992456436, 0.010443519800901413, 0.01773875020444393, -0.0522683784365654, -0.06712965667247772, 0.03872734680771828, 0.067908...
722,405
paramz.core.observable_array
ObsAr
An ndarray which reports changes to its observers. .. warning:: ObsAr tries to not ever give back an observable array itself. Thus, if you want to preserve an ObsAr you need to work in memory. Let `a` be an ObsAr and you want to add a random number `r` to it. You need to make sure...
class ObsAr(np.ndarray, Pickleable, Observable): """ An ndarray which reports changes to its observers. .. warning:: ObsAr tries to not ever give back an observable array itself. Thus, if you want to preserve an ObsAr you need to work in memory. Let `a` be an ObsAr and you want to add...
(input_array, *a, **kw)
[ -0.008930717594921589, -0.04495418816804886, -0.017328113317489624, 0.02193407528102398, 0.007112574763596058, -0.031126605346798897, -0.08401274681091309, 0.01638752780854702, 0.00041180936386808753, -0.01523361261934042, -0.03601377457380295, -0.017657803371548653, 0.03603316843509674, 0...
722,406
paramz.core.observable_array
__array_finalize__
null
def __array_finalize__(self, obj): # see InfoArray.__array_finalize__ for comments if obj is None: return self.observers = getattr(obj, 'observers', None) self._update_on = getattr(obj, '_update_on', None)
(self, obj)
[ 0.0011575882090255618, 0.011786352843046188, -0.02011561393737793, -0.0010898569598793983, -0.05491938814520836, -0.05201758071780205, -0.05843021720647812, 0.05201758071780205, -0.005620012525469065, -0.006264858413487673, -0.01824376918375492, -0.01603158935904503, 0.026170002296566963, ...
722,407
paramz.core.observable_array
__array_wrap__
null
def __array_wrap__(self, out_arr, context=None): #np.ndarray.__array_wrap__(self, out_arr, context) #return out_arr return out_arr.view(np.ndarray)
(self, out_arr, context=None)
[ -0.030554896220564842, -0.07077288627624512, -0.007306239567697048, 0.031059935688972473, -0.00871193315833807, 0.025504499673843384, -0.05515032634139061, 0.02695227973163128, 0.04010014608502388, -0.04932553693652153, 0.030201368033885956, -0.06780998408794403, -0.015504715964198112, -0....
722,408
paramz.core.observable_array
__deepcopy__
null
def __deepcopy__(self, memo): s = self.__new__(self.__class__, input_array=self.view(np.ndarray).copy()) memo[id(self)] = s import copy Pickleable.__setstate__(s, copy.deepcopy(self.__getstate__(), memo)) return s
(self, memo)
[ -0.008332889527082443, -0.058901697397232056, 0.06255204230546951, 0.026101745665073395, -0.09320785850286484, 0.0035528852604329586, -0.044654715806245804, 0.02588910423219204, 0.0064634159207344055, -0.019811101257801056, -0.029007846489548683, 0.04164229705929756, -0.049687232822179794, ...
722,409
paramz.core.observable_array
__getslice__
null
def __getslice__(self, start, stop): #pragma: no cover return self.__getitem__(slice(start, stop))
(self, start, stop)
[ -0.002232555765658617, -0.02063104324042797, -0.07605944573879242, -0.0015739209484308958, -0.029223186895251274, -0.0004079104110132903, 0.02094438299536705, 0.009062156081199646, 0.06405353546142578, -0.06718694418668747, 0.018553094938397408, -0.000021500332877621986, 0.008534424006938934...
722,411
paramz.core.observable_array
__iadd__
null
def __iadd__(self, *args, **kwargs): #pragma: no cover r = np.ndarray.__iadd__(self, *args, **kwargs) self.notify_observers() return r
(self, *args, **kwargs)
[ -0.06248942390084267, -0.07366258651018143, 0.03196394070982933, 0.06784183531999588, -0.011348788626492023, -0.011114620603621006, -0.05442735180258751, 0.009893600828945637, 0.0058667464181780815, -0.011900756508111954, 0.01633322238922119, -0.027447843924164772, 0.03065929189324379, 0.0...
722,412
paramz.core.observable_array
__iand__
null
def __iand__(self, *args, **kwargs): #pragma: no cover r = np.ndarray.__iand__(self, *args, **kwargs) self.notify_observers() return r
(self, *args, **kwargs)
[ -0.005315050482749939, -0.0894988626241684, 0.02912934683263302, 0.034195318818092346, -0.03328344598412514, -0.0156623013317585, -0.03284439444541931, 0.0008828514255583286, 0.018524575978517532, -0.00339631293900311, 0.03880535811185837, -0.01138155348598957, 0.04032514989376068, 0.03914...
722,413
paramz.core.observable_array
__idiv__
null
def __idiv__(self, *args, **kwargs): #pragma: no cover r = np.ndarray.__idiv__(self, *args, **kwargs) self.notify_observers() return r
(self, *args, **kwargs)
[ -0.0028393499087542295, -0.09133172035217285, 0.029178224503993988, 0.036316677927970886, -0.0035586801823228598, -0.011374276131391525, -0.03530413284897804, -0.019322767853736877, 0.0060752807185053825, 0.00992295891046524, 0.012648397125303745, -0.04519334062933922, 0.017837699502706528, ...
722,414
paramz.core.observable_array
__ifloordiv__
null
def __ifloordiv__(self, *args, **kwargs): #pragma: no cover r = np.ndarray.__ifloordiv__(self, *args, **kwargs) self.notify_observers() return r
(self, *args, **kwargs)
[ -0.04464462399482727, -0.0430864654481411, -0.0008785811369307339, 0.06127627193927765, -0.0027648843824863434, -0.011736997403204441, -0.0007176843355409801, -0.05314674973487854, -0.05995522439479828, 0.03217935934662819, 0.0400717668235302, -0.04295097291469574, 0.05731312930583954, -0....
722,415
paramz.core.observable_array
__ilshift__
null
def __ilshift__(self, *args, **kwargs): #pragma: no cover r = np.ndarray.__ilshift__(self, *args, **kwargs) self.notify_observers() return r
(self, *args, **kwargs)
[ -0.06683988124132156, -0.03162839263677597, 0.007668503560125828, 0.029468486085534096, -0.024378474801778793, -0.039347127079963684, -0.02585189789533615, 0.01952287182211876, 0.018384316936135292, -0.01641695946455002, 0.00894937850534916, -0.05508597567677498, 0.05769795551896095, 0.020...
722,416
paramz.core.observable_array
__imod__
null
def __imod__(self, *args, **kwargs): #pragma: no cover r = np.ndarray.__imod__(self, *args, **kwargs) self.notify_observers() return r
(self, *args, **kwargs)
[ 0.005169818177819252, -0.06568709760904312, 0.013177967630326748, 0.03564809262752533, -0.04227086529135704, -0.011936197988688946, -0.07136376202106476, 0.050785861909389496, 0.018263312056660652, 0.011040771380066872, 0.02221670188009739, -0.02502124384045601, 0.002853114390745759, 0.012...
722,417
paramz.core.observable_array
__imul__
null
def __imul__(self, *args, **kwargs): #pragma: no cover r = np.ndarray.__imul__(self, *args, **kwargs) self.notify_observers() return r
(self, *args, **kwargs)
[ -0.020725766196846962, -0.08164695650339127, 0.029105322435498238, 0.08336584270000458, -0.0250890851020813, -0.025816304609179497, -0.026841023936867714, -0.03546849638223648, -0.01713925041258335, 0.024378392845392227, 0.01841188408434391, -0.025733666494488716, 0.04412902146577835, 0.02...
722,418
paramz.core.pickleable
__init__
null
def __init__(self, *a, **kw): super(Pickleable, self).__init__()
(self, *a, **kw)
[ -0.036233264952898026, -0.00512476172298193, -0.022744344547390938, 0.027971943840384483, -0.03585619106888771, -0.003877850715070963, -0.0387013778090477, 0.05457271263003349, -0.018082354217767715, -0.02226443402469158, -0.010258093476295471, 0.068181611597538, -0.06585061550140381, 0.03...
722,419
paramz.core.observable_array
__ior__
null
def __ior__(self, *args, **kwargs): #pragma: no cover r = np.ndarray.__ior__(self, *args, **kwargs) self.notify_observers() return r
(self, *args, **kwargs)
[ -0.025687258690595627, -0.07260666787624359, 0.0047822026535868645, 0.03454779088497162, -0.03984754532575607, -0.04024503007531166, -0.03477965295314789, 0.02318643592298031, 0.025041351094841957, 0.004591742530465126, 0.03842323645949364, -0.014731667935848236, 0.021381206810474396, 0.03...
722,420
paramz.core.observable_array
__ipow__
null
def __ipow__(self, *args, **kwargs): #pragma: no cover r = np.ndarray.__ipow__(self, *args, **kwargs) self.notify_observers() return r
(self, *args, **kwargs)
[ -0.026321809738874435, -0.08141756057739258, -0.0033888258039951324, 0.018948273733258247, -0.032254934310913086, -0.02352672442793846, -0.0177136342972517, 0.01903401128947735, 0.049762796610593796, 0.0023213778622448444, 0.024881398305296898, -0.040057163685560226, 0.039954278618097305, ...
722,421
paramz.core.observable_array
__irshift__
null
def __irshift__(self, *args, **kwargs): #pragma: no cover r = np.ndarray.__irshift__(self, *args, **kwargs) self.notify_observers() return r
(self, *args, **kwargs)
[ -0.04776468127965927, -0.051474884152412415, 0.006931561045348644, 0.019286368042230606, -0.016645774245262146, -0.03543076291680336, -0.027926795184612274, 0.03593214228749275, 0.03619954362511635, -0.0034407114144414663, 0.01898554153740406, -0.042984869331121445, 0.0525779165327549, 0.0...
722,422
paramz.core.observable_array
__isub__
null
def __isub__(self, *args, **kwargs): #pragma: no cover r = np.ndarray.__isub__(self, *args, **kwargs) self.notify_observers() return r
(self, *args, **kwargs)
[ -0.011854873038828373, -0.06287078559398651, -0.028854627162218094, 0.035864319652318954, -0.07705667614936829, -0.00036864366848021746, -0.0327007994055748, 0.03789563104510307, 0.022061385214328766, 0.001705594826489687, 0.0016847822116687894, -0.015717696398496628, -0.0019220461836084723,...
722,423
paramz.core.observable_array
__itruediv__
null
def __itruediv__(self, *args, **kwargs): #pragma: no cover r = np.ndarray.__itruediv__(self, *args, **kwargs) self.notify_observers() return r
(self, *args, **kwargs)
[ 0.00020999570551794022, -0.09426497668027878, 0.008015410974621773, 0.049613144248723984, -0.008499649353325367, -0.0158014465123415, -0.06402134150266647, -0.0030286104883998632, 0.013813522644340992, 0.01255620364099741, 0.03168784826993942, 0.0017224426846951246, 0.010568278841674328, 0...
722,424
paramz.core.observable_array
__ixor__
null
def __ixor__(self, *args, **kwargs): #pragma: no cover r = np.ndarray.__ixor__(self, *args, **kwargs) self.notify_observers() return r
(self, *args, **kwargs)
[ -0.019287094473838806, -0.092658631503582, 0.037902750074863434, 0.0377013199031353, -0.00973587017506361, -0.0370970256626606, -0.044650718569755554, 0.017793143168091774, 0.045288585126399994, -0.004326587542891502, 0.054823022335767746, -0.006559123285114765, 0.025531481951475143, -0.00...
722,425
paramz.core.observable_array
__new__
null
def __new__(cls, input_array, *a, **kw): # allways make a copy of input paramters, as we need it to be in C order: if not isinstance(input_array, ObsAr): try: # try to cast ints to floats obj = np.atleast_1d(np.require(input_array, dtype=np.float_, requirements=['W', 'C'])).view(...
(cls, input_array, *a, **kw)
[ 0.0028019226156175137, -0.05819237232208252, 0.015816716477274895, -0.03411591798067093, -0.002194991335272789, -0.03033742867410183, -0.045268844813108444, 0.015853222459554672, -0.022908227518200874, -0.008624810725450516, -0.020955095067620277, -0.011271577328443527, -0.007246666122227907...
722,426
paramz.core.observable_array
__reduce__
null
def __reduce__(self): func, args, state = super(ObsAr, self).__reduce__() return func, args, (state, Pickleable.__getstate__(self))
(self)
[ -0.003977487329393625, -0.04569190740585327, -0.03935941308736801, 0.02639704756438732, 0.011020636186003685, -0.019469790160655975, -0.0490155927836895, -0.024962615221738815, 0.03465377911925316, -0.04156354069709778, -0.014781646430492401, 0.042158305644989014, 0.011204313486814499, 0.0...
722,427
paramz.core.observable_array
__setitem__
null
def __setitem__(self, s, val): super(ObsAr, self).__setitem__(s, val) self.notify_observers()
(self, s, val)
[ 0.02310645952820778, -0.0020774633157998323, -0.0429903082549572, 0.005091394297778606, -0.014127996750175953, -0.013239286839962006, -0.06275787204504013, 0.04980098083615303, 0.03584740310907364, -0.002906995126977563, -0.06392066925764084, -0.007109679747372866, 0.03993380814790726, 0.0...
722,428
paramz.core.observable_array
__setslice__
null
def __setslice__(self, start, stop, val): #pragma: no cover return self.__setitem__(slice(start, stop), val)
(self, start, stop, val)
[ 0.018184136599302292, 0.0048734149895608425, -0.07247132807970047, -0.01497663464397192, -0.03825796768069267, 0.029837235808372498, -0.02494724467396736, 0.022908367216587067, 0.0321744866669178, -0.05562986806035042, -0.03036767616868019, -0.022162435576319695, 0.023289620876312256, 0.01...
722,429
paramz.core.observable_array
__setstate__
null
def __setstate__(self, state): np.ndarray.__setstate__(self, state[0]) Pickleable.__setstate__(self, state[1])
(self, state)
[ -0.022009065374732018, -0.014725489541888237, 0.011989750899374485, 0.048909034579992294, -0.04894421994686127, -0.011391582898795605, -0.08128047734498978, 0.025844378396868706, 0.009333181194961071, -0.03026026487350464, -0.03916241228580475, 0.022818351164460182, -0.013370814733207226, ...
722,430
paramz.core.observable_array
_setup_observers
null
def _setup_observers(self): # do not setup anything, as observable arrays do not have default observers pass
(self)
[ -0.02245447412133217, 0.03535953536629677, 0.0038064089603722095, -0.01995025761425495, -0.015643004328012466, 0.01869814842939377, -0.05479225516319275, 0.050885677337646484, 0.004595237318426371, 0.050184495747089386, 0.0023518765810877085, 0.006803121417760849, 0.057530198246240616, 0.0...
722,433
paramz.core.observable_array
copy
Make a copy. This means, we delete all observers and return a copy of this array. It will still be an ObsAr!
def copy(self): """ Make a copy. This means, we delete all observers and return a copy of this array. It will still be an ObsAr! """ from .lists_and_dicts import ObserverList memo = {} memo[id(self)] = self memo[id(self.observers)] = ObserverList() return self.__deepcopy__(memo)
(self)
[ -0.01777256466448307, -0.016589531674981117, -0.044323038309812546, -0.04396180808544159, -0.07621973752975464, -0.030939431861042976, -0.05953086540102959, 0.031770262867212296, 0.04862168803811073, 0.016047686338424683, -0.052884213626384735, -0.054618123918771744, -0.02266724407672882, ...
722,438
paramz.param
Param
Parameter object for GPy models. :param str name: name of the parameter to be printed :param input_array: array which this parameter handles :type input_array: np.ndarray :param default_constraint: The default constraint for this parameter :type default_constraint: ...
class Param(Parameterizable, ObsAr): """ Parameter object for GPy models. :param str name: name of the parameter to be printed :param input_array: array which this parameter handles :type input_array: np.ndarray :param default_constraint: The default constraint for this...
(name, input_array, default_constraint=None)
[ 0.052980951964855194, -0.045336730778217316, -0.035008903592824936, 0.0405997559428215, -0.011527321301400661, -0.022282090038061142, -0.06489454954862595, -0.05058196932077408, 0.0005435197963379323, -0.05208641663193703, -0.013489202596247196, -0.034033045172691345, 0.006337993778288364, ...
722,439
paramz.param
__array_finalize__
null
def __array_finalize__(self, obj): # see InfoArray.__array_finalize__ for comments if obj is None: return super(Param, self).__array_finalize__(obj) self._parent_ = getattr(obj, '_parent_', None) self._parent_index_ = getattr(obj, '_parent_index_', None) self._default_constraint_ = getattr(obj, ...
(self, obj)
[ 0.02870084159076214, -0.019589178264141083, -0.007426814176142216, 0.015895988792181015, -0.05887536332011223, -0.0332476869225502, -0.0341462716460228, -0.014422307722270489, -0.014772756025195122, -0.03355320543050766, -0.00827597826719284, -0.03881892189383507, 0.027334989979863167, -0....
722,441
paramz.param
__deepcopy__
null
def __deepcopy__(self, memo): s = self.__new__(self.__class__, name=self.name, input_array=self.view(np.ndarray).copy()) memo[id(self)] = s import copy Pickleable.__setstate__(s, copy.deepcopy(self.__getstate__(), memo)) return s
(self, memo)
[ -0.008205674588680267, -0.060814350843429565, 0.06092091649770737, 0.021988365799188614, -0.09385018795728683, 0.0030194041319191456, -0.04539762809872627, 0.023498067632317543, 0.005923360586166382, -0.017530305311083794, -0.025700457394123077, 0.03804449364542961, -0.05093912407755852, 0...
722,442
paramz.param
__getitem__
null
def __getitem__(self, s, *args, **kwargs): if not isinstance(s, tuple): s = (s,) #if not reduce(lambda a, b: a or np.any(b is Ellipsis), s, False) and len(s) <= self.ndim: # s += (Ellipsis,) new_arr = super(Param, self).__getitem__(s, *args, **kwargs) try: new_arr._current_slice_ ...
(self, s, *args, **kwargs)
[ -0.007665671408176422, -0.05357326194643974, -0.01885254681110382, 0.011655460111796856, -0.041271794587373734, 0.004076226614415646, -0.0290067195892334, -0.014840012416243553, 0.05695798620581627, -0.018343020230531693, 0.005850476678460836, -0.0007984126568771899, 0.01325683481991291, -...
722,452
paramz.param
__init__
null
def __init__(self, name, input_array, default_constraint=None, *a, **kw): self._in_init_ = True super(Param, self).__init__(name=name, default_constraint=default_constraint, *a, **kw) self._in_init_ = False
(self, name, input_array, default_constraint=None, *a, **kw)
[ 0.013494282960891724, 0.0006197454058565199, 0.027385203167796135, -0.008657035417854786, -0.04173311963677406, -0.01329596433788538, -0.03392109274864197, -0.027609389275312424, 0.02095278538763523, -0.03314506262540817, -0.005078678950667381, -0.015417110174894333, 0.0004683119768742472, ...
722,459
paramz.param
__new__
null
def __new__(cls, name, input_array, default_constraint=None): obj = super(Param, cls).__new__(cls, input_array=input_array) obj._current_slice_ = (slice(obj.shape[0]),) obj._realshape_ = obj.shape obj._realsize_ = obj.size obj._realndim_ = obj.ndim obj._original_ = obj return obj
(cls, name, input_array, default_constraint=None)
[ 0.052082572132349014, -0.03790046274662018, -0.0036590539384633303, -0.020068032667040825, -0.04195249453186989, -0.006239603739231825, -0.032852888107299805, -0.04715725779533386, 0.030233042314648628, -0.021674873307347298, 0.02361355908215046, -0.009125802665948868, -0.009937955066561699,...
722,461
paramz.param
__repr__
null
def __repr__(self, *args, **kwargs): name = "\033[1m{x:s}\033[0;0m:\n".format( x=self.hierarchy_name()) return name + super(Param, self).__repr__(*args, **kwargs)
(self, *args, **kwargs)
[ 0.018413826823234558, -0.035287465900182724, 0.07372376322746277, 0.020262055099010468, 0.01112359482795, -0.026799306273460388, -0.0006914811674505472, -0.04216698184609413, 0.038641657680273056, -0.010969575494527817, 0.0046334052458405495, -0.014357993379235268, 0.013083058409392834, 0....
722,464
paramz.core.parameter_core
__setstate__
null
def __setstate__(self, state): super(Parameterizable, self).__setstate__(state) self.logger = logging.getLogger(self.__class__.__name__) return self
(self, state)
[ -0.03876565396785736, -0.02236619032919407, 0.03565572202205658, 0.03811473771929741, -0.0005760492058470845, 0.002454495057463646, -0.04437076300382614, -0.01661643385887146, 0.024282775819301605, -0.01699613593518734, -0.027754327282309532, 0.037789277732372284, -0.016390422359108925, 0....
722,465
paramz.param
__str__
null
def __str__(self, indices=None, iops=None, lx=None, li=None, lls=None, only_name=False, VT100=True): filter_ = self._current_slice_ vals = self.flat if indices is None: indices = self._indices(filter_) if iops is None: ravi = self._raveled_index(filter_) iops = OrderedDict([name, iop.pro...
(self, indices=None, iops=None, lx=None, li=None, lls=None, only_name=False, VT100=True)
[ 0.00007056921458570287, -0.05846690014004707, 0.04540867730975151, -0.026079557836055756, 0.016894536092877388, -0.035227689892053604, -0.017918167635798454, -0.07296374440193176, 0.03579945117235184, -0.033235758543014526, -0.010282428003847599, 0.005574643611907959, 0.023958519101142883, ...
722,469
paramz.core.gradcheckable
_checkgrad
Perform the checkgrad on the model. TODO: this can be done more efficiently, when doing it inside here
def _checkgrad(self, param, verbose=0, step=1e-6, tolerance=1e-3, df_tolerance=1e-12): """ Perform the checkgrad on the model. TODO: this can be done more efficiently, when doing it inside here """ raise HierarchyError("This parameter is not in a model with a likelihood, and, therefore, cannot be gr...
(self, param, verbose=0, step=1e-06, tolerance=0.001, df_tolerance=1e-12)
[ 0.03088936023414135, 0.030706088989973068, 0.018093766644597054, 0.08150525391101837, -0.029789738357067108, 0.013745265081524849, -0.031589116901159286, -0.03605424612760544, -0.01032144483178854, -0.00923848431557417, 0.005348157603293657, -0.022992080077528954, 0.07264164090156555, -0.0...
722,471
paramz.core.parameter_core
_connect_parameters
null
def _connect_parameters(self): pass
(self)
[ -0.03759539872407913, -0.06935643404722214, 0.02138691395521164, 0.007461254019290209, -0.009036359377205372, 0.02729032374918461, -0.024580279365181923, 0.06618033349514008, 0.05278545990586281, -0.0046303789131343365, -0.031761035323143005, 0.02007504552602768, 0.017537614330649376, 0.05...
722,473
paramz.param
_ensure_fixes
null
def _ensure_fixes(self): if (not hasattr(self, "_fixes_")) or (self._fixes_ is None) or (self._fixes_.size != self._realsize_): self._fixes_ = np.ones(self._realsize_, dtype=bool)
(self)
[ -0.0011122984578832984, 0.02402394637465477, 0.023887833580374718, 0.011442000046372414, -0.0018173212883993983, -0.000007024142178124748, -0.0420929491519928, 0.06509604305028915, 0.01881762407720089, -0.018188100308179855, 0.007001312915235758, 0.017609620466828346, 0.023037126287817955, ...
722,474
paramz.param
_format_spec
null
def _format_spec(self, indices, iops, lx=None, li=None, lls=None, VT100=True): if li is None: li = self._max_len_index(indices) if lx is None: lx = self._max_len_values() if lls is None: lls = [self._max_len_names(iop, name) for name, iop in iops.items()] if VT100: format_spec = [" \033[1m{{ind...
(self, indices, iops, lx=None, li=None, lls=None, VT100=True)
[ 0.03039134293794632, -0.027195041999220848, 0.015301626175642014, -0.05212971568107605, 0.0237515140324831, 0.0013310560025274754, -0.03191002830862999, -0.029243499040603638, -0.02104966901242733, 0.017111685127019882, 0.014030169695615768, -0.00151537312194705, -0.015178011730313301, -0....
722,475
paramz.param
_get_original
null
def _get_original(self, param): return self._original_
(self, param)
[ 0.05366632714867592, -0.015582672320306301, 0.016241559758782387, 0.0691831111907959, -0.03917082026600838, -0.04819756746292114, 0.015244993381202221, 0.03574460744857788, 0.1296689212322235, -0.013202443718910217, -0.005258739925920963, -0.05478643625974655, -0.04490313306450844, 0.00625...
722,477
paramz.param
_indices
null
def _indices(self, slice_index=None): # get a int-array containing all indices in the first axis. if slice_index is None: slice_index = self._current_slice_ #try: indices = np.indices(self._realshape_, dtype=int) indices = indices[(slice(None),)+slice_index] indices = np.rollaxis(indices...
(self, slice_index=None)
[ -0.05670264735817909, -0.05456086993217468, -0.009007262997329235, 0.04022185131907463, 0.010926694609224796, -0.024630438536405563, -0.01412121020257473, 0.042617738246917725, -0.02582838200032711, -0.008893821388483047, -0.010917618870735168, -0.022343456745147705, 0.006761119235306978, ...
722,478
paramz.param
_max_len_index
null
def _max_len_index(self, ind): return reduce(lambda a, b: max(a, len(str(b))), ind, len(__index_name__))
(self, ind)
[ 0.013926810584962368, -0.000996735179796815, 0.02577347867190838, 0.04211021214723587, -0.006354582961648703, 0.013994458131492138, -0.0003791927301790565, 0.024775687605142593, 0.05452342331409454, -0.08286748081445694, -0.00003005795952049084, 0.013690046966075897, -0.01498379372060299, ...
722,479
paramz.param
_max_len_names
null
def _max_len_names(self, gen, header): return reduce(lambda a, b: max(a, len(" ".join(map(str, b)))), gen, len(header))
(self, gen, header)
[ 0.0004445631057024002, 0.02068476565182209, 0.018839409574866295, -0.0026673786342144012, -0.021305477246642113, 0.005716410465538502, 0.0015329038724303246, 0.00027470645727589726, 0.0542534738779068, -0.05089827999472618, 0.018839409574866295, 0.03791368380188942, 0.003938158042728901, -...
722,480
paramz.param
_max_len_values
null
def _max_len_values(self): return reduce(lambda a, b: max(a, len("{x:=.{0}g}".format(__precision__, x=b))), self.flat, len(self.hierarchy_name()))
(self)
[ 0.005833727307617664, 0.007182937581092119, 0.025870569050312042, 0.054893575608730316, -0.0006419455748982728, 0.015787899494171143, 0.00659613823518157, -0.0458131805062294, 0.037795014679431915, -0.022375471889972687, 0.010493856854736805, 0.028286296874284744, 0.002077355282381177, -0....
722,488
paramz.param
_raveled_index
null
def _raveled_index(self, slice_index=None): # return an index array on the raveled array, which is formed by the current_slice # of this object extended_realshape = np.cumprod((1,) + self._realshape_[:0:-1])[::-1] ind = self._indices(slice_index) if ind.ndim < 2: ind = ind[:, None] return np.asa...
(self, slice_index=None)
[ -0.034796856343746185, -0.045568596571683884, -0.032045476138591766, 0.08732482045888901, 0.023773355409502983, -0.03952635079622269, -0.013873784802854061, 0.02988753281533718, 0.008105779066681862, -0.01133820042014122, -0.006338961888104677, -0.01116736326366663, -0.0059118689969182014, ...
722,489
paramz.param
_raveled_index_for
null
def _raveled_index_for(self, obj): return self._raveled_index()
(self, obj)
[ 0.01698678359389305, -0.026551751419901848, -0.05363720655441284, 0.04619871452450752, 0.020997898653149605, -0.028369680047035217, 0.01133286114782095, 0.03333979472517967, -0.007104928605258465, -0.03227238729596138, -0.03822651877999306, -0.011774834245443344, -0.010165384970605373, -0....
722,493
paramz.param
_repr_html_
Representation of the parameter in html for notebook display.
def _repr_html_(self, indices=None, iops=None, lx=None, li=None, lls=None): """Representation of the parameter in html for notebook display.""" filter_ = self._current_slice_ vals = self.flat if indices is None: indices = self._indices(filter_) if iops is None: ravi = self._raveled_index(fil...
(self, indices=None, iops=None, lx=None, li=None, lls=None)
[ 0.0006218152120709419, -0.05440300703048706, -0.008686781860888004, -0.014364629983901978, 0.009716153144836426, -0.005090966355055571, -0.0464288666844368, -0.04445396363735199, -0.022171087563037872, -0.002394104842096567, 0.012995238415896893, 0.016842573881149292, 0.02541291154921055, ...
722,496
paramz.param
_setup_observers
Setup the default observers 1: pass through to parent, if present
def _setup_observers(self): """ Setup the default observers 1: pass through to parent, if present """ if self.has_parent(): self.add_observer(self._parent_, self._parent_._pass_through_notify_observers, -np.inf)
(self)
[ -0.01617036759853363, 0.04101330414414406, 0.008676888421177864, 0.03282446414232254, -0.0477164052426815, 0.007290486246347427, -0.0003239256329834461, 0.06312663108110428, 0.03914749249815941, 0.059014931321144104, 0.008612102828919888, -0.020282063633203506, 0.051309820264577866, 0.0066...
722,503
paramz.param
build_pydot
Build a pydot representation of this model. This needs pydot installed. Example Usage: np.random.seed(1000) X = np.random.normal(0,1,(20,2)) beta = np.random.uniform(0,1,(2,1)) Y = X.dot(beta) m = RidgeRegression(X, Y) G = m.build_pydot() G.writ...
def build_pydot(self,G): # pragma: no cover """ Build a pydot representation of this model. This needs pydot installed. Example Usage: np.random.seed(1000) X = np.random.normal(0,1,(20,2)) beta = np.random.uniform(0,1,(2,1)) Y = X.dot(beta) m = RidgeRegression(X, Y) G = m.build_pydot...
(self, G)
[ 0.05118698626756668, -0.08412983268499374, 0.07659582048654556, 0.03543572500348091, -0.039775166660547256, -0.037060707807540894, -0.06865555793046951, -0.007363207172602415, 0.061934035271406174, -0.011919624172151089, 0.00491188233718276, -0.027476996183395386, 0.0013110663276165724, 0....
722,511
paramz.param
copy
null
def copy(self): return Parameterizable.copy(self, which=self)
(self)
[ 0.01612955890595913, -0.0337752103805542, 0.014605041593313217, -0.03153476119041443, -0.0718291774392128, -0.00038007640978321433, 0.01068846508860588, -0.01451239176094532, 0.07263775914907455, 0.002931115683168173, -0.013375320471823215, -0.03244441747665405, -0.05788110941648483, 0.064...
722,515
paramz.param
get_property_string
null
def get_property_string(self, propname): prop = self._index_operations[propname] return [' '.join(map(lambda c: str(c[0]) if c[1].size == self._realsize_ else "{" + str(c[0]) + "}", prop.items()))]
(self, propname)
[ 0.038798317313194275, -0.05990098789334297, 0.031601857393980026, -0.02616105228662491, 0.04655103012919426, -0.016435399651527405, -0.011698597110807896, -0.061395905911922455, 0.050618596374988556, -0.04196198284626007, 0.02440539374947548, 0.03938933461904526, -0.007956958375871181, -0....
722,520
paramz.param
parameter_names
null
def parameter_names(self, add_self=False, adjust_for_printing=False, recursive=True, **kw): # this is just overwrighting the parameterized calls to # parameter names, in order to maintain OOP if adjust_for_printing: return [adjust_name_for_printing(self.name)] return [self.name]
(self, add_self=False, adjust_for_printing=False, recursive=True, **kw)
[ -0.00501333037391305, -0.016897102817893028, 0.023383915424346924, 0.01542361918836832, -0.04837209731340408, -0.014054762199521065, 0.00850086472928524, -0.03668886050581932, 0.06322899460792542, -0.011055483482778072, -0.005667243152856827, -0.03225969150662422, 0.038188498467206955, 0.0...
722,541
paramz.parameterized
Parameterized
Say m is a handle to a parameterized class. Printing parameters:: - print m: prints a nice summary over all parameters - print m.name: prints details for param with name 'name' - print m[regexp]: prints details for all the parameters which m...
class Parameterized(with_metaclass(ParametersChangedMeta, Parameterizable)): """ Say m is a handle to a parameterized class. Printing parameters:: - print m: prints a nice summary over all parameters - print m.name: prints details for param with name 'name' - print m...
(*args, **kw)
[ 0.049715202301740646, -0.01406856719404459, -0.023834053426980972, 0.04791877046227455, -0.022330064326524734, -0.012669021263718605, -0.0677630752325058, -0.002317344769835472, 0.009013491682708263, -0.030246896669268608, -0.020940963178873062, -0.014987671747803688, -0.0022794839460402727,...
722,545
paramz.parameterized
__init__
null
def __init__(self, name=None, parameters=[]): super(Parameterized, self).__init__(name=name) self.size = sum(p.size for p in self.parameters) self.add_observer(self, self._parameters_changed_notification, -100) self._fixes_ = None self._param_slices_ = [] #self._connect_parameters() self.lin...
(self, name=None, parameters=[])
[ 0.031211670488119125, -0.017545340582728386, -0.015103000216186047, -0.0042449128814041615, -0.03580901399254799, 0.013702246360480785, -0.07679004222154617, 0.00024313967151101679, 0.005454858765006065, 0.026686158031225204, -0.023884648457169533, 0.0382513552904129, -0.038790106773376465, ...
722,549
paramz.parameterized
__str__
null
def __str__(self, header=True, VT100=True): name = adjust_name_for_printing(self.name) + "." names = self.parameter_names(adjust_for_printing=True) desc = self._description_str iops = OrderedDict() for opname in self._index_operations: iops[opname] = self.get_property_string(opname) form...
(self, header=True, VT100=True)
[ 0.02090860716998577, -0.03470580652356148, 0.0294564850628376, -0.06359479576349258, 0.047031063586473465, -0.07391609251499176, -0.005284787621349096, -0.0771791860461235, 0.021919455379247665, -0.0345284640789032, -0.02119235321879387, 0.00288845575414598, 0.008698618970811367, 0.0145509...
722,573
paramz.parameterized
_repr_html_
Representation of the parameters in html for notebook display.
def _repr_html_(self, header=True): """Representation of the parameters in html for notebook display.""" name = adjust_name_for_printing(self.name) + "." names = self.parameter_names() desc = self._description_str iops = OrderedDict() for opname in self._index_operations: iop = [] ...
(self, header=True)
[ 0.016852186992764473, -0.0570770762860775, -0.005274210590869188, -0.03021833673119545, 0.014657609164714813, -0.0059425183571875095, -0.03771422058343887, -0.03408368304371834, -0.011171572841703892, -0.01166828814893961, 0.0073694451712071896, 0.0053419447503983974, 0.00429884297773242, ...
722,626
paramz
_unpickle
null
def _unpickle(file_or_path, pickle, strcl, p3kw): if isinstance(file_or_path, strcl): with open(file_or_path, 'rb') as f: m = pickle.load(f, **p3kw) else: m = pickle.load(file_or_path, **p3kw) return m
(file_or_path, pickle, strcl, p3kw)
[ 0.03422261402010918, -0.010872992686927319, -0.010696769692003727, 0.06456831097602844, -0.05219741538167, -0.03760610520839691, 0.0014119911938905716, 0.05875293165445328, 0.031825970858335495, -0.011445719748735428, 0.017869068309664726, 0.031878840178251266, -0.08853471279144287, 0.0145...
722,632
paramz
load
Load a previously pickled model, using `m.pickle('path/to/file.pickle)'` :param file_name: path/to/file.pickle
def load(file_or_path): """ Load a previously pickled model, using `m.pickle('path/to/file.pickle)'` :param file_name: path/to/file.pickle """ from pickle import UnpicklingError _python3 = True try: import cPickle as pickle _python3 = False except ImportError: #python3 ...
(file_or_path)
[ 0.03922893479466438, -0.013710477389395237, -0.0209006629884243, 0.08288809657096863, -0.01516637858003378, -0.04022930935025215, -0.03740682825446129, 0.015193173661828041, 0.021150756627321243, -0.02383032813668251, 0.005390406120568514, 0.029314519837498665, -0.0771716758608818, 0.01191...
722,671
stackprinter.tracing
TracePrinter
Print a trace of all calls & returns in a piece of code as they are executed Example: ``` with Traceprinter(style='color', depth_limit=5): dosomething() dosomethingelse() ``` Params --- Accepts all keyword wargs accepted by stackprinter.format, and: depth_limit: i...
class TracePrinter(): """ Print a trace of all calls & returns in a piece of code as they are executed Example: ``` with Traceprinter(style='color', depth_limit=5): dosomething() dosomethingelse() ``` Params --- Accepts all keyword wargs accepted by stackprinter.for...
(suppressed_paths=[], depth_limit=20, print_function=<built-in function print>, stop_on_exception=True, **formatter_kwargs)
[ 0.02295651100575924, -0.01983124203979969, 0.008390869945287704, 0.040533773601055145, -0.024301322177052498, -0.01739732176065445, -0.0383366160094738, 0.019433481618762016, 0.0023119875695556402, -0.07193797826766968, -0.015578985214233398, -0.02916916273534298, 0.025494607165455818, -0....
722,672
stackprinter.tracing
__enter__
null
def __enter__(self): depth = count_stack(sys._getframe(1)) self.enable(current_depth=depth) return self
(self)
[ 0.01719403825700283, -0.023936133831739426, 0.011586918495595455, 0.04804166778922081, -0.017871635034680367, 0.041299570351839066, -0.010333362966775894, -0.03243998438119888, 0.001252496731467545, -0.03150828555226326, -0.000028238746381248347, -0.05339468643069267, -0.005513950251042843, ...
722,673
stackprinter.tracing
__exit__
null
def __exit__(self, etype, evalue, tb): self.disable() if etype is None: return True
(self, etype, evalue, tb)
[ 0.06537878513336182, 0.01919250376522541, 0.03374221920967102, -0.015852801501750946, -0.02778770960867405, -0.042699869722127914, -0.006735499016940594, -0.005531652830541134, -0.01020033285021782, -0.04597916454076767, -0.0033957960549741983, -0.009829254820942879, -0.009846514090895653, ...
722,674
stackprinter.tracing
__init__
null
def __init__(self, suppressed_paths=[], depth_limit=20, print_function=print, stop_on_exception=True, **formatter_kwargs): self.fmt = get_formatter(**formatter_kwargs) self.fmt_style = formatter_kwargs.get('style', 'plaintext') assert isinstan...
(self, suppressed_paths=[], depth_limit=20, print_function=<built-in function print>, stop_on_exception=True, **formatter_kwargs)
[ -0.01953206956386566, 0.004442189354449511, 0.027055533602833748, -0.004625302739441395, -0.029894918203353882, 0.016801197081804276, -0.02065335586667061, -0.011104343459010124, -0.030491730198264122, -0.011176683939993382, 0.0005784453824162483, 0.04760037735104561, 0.002861990826204419, ...
722,675
stackprinter.tracing
disable
null
def disable(self): sys.settrace(self.trace_before) try: del self.previous_frame except AttributeError: pass
(self)
[ -0.012783597223460674, 0.0405823215842247, -0.0009669617284089327, 0.05309216305613518, -0.07924005389213562, -0.028188619762659073, -0.04555971175432205, 0.06746022403240204, -0.007300172001123428, -0.04356875643134117, -0.04688701406121254, -0.03265167772769928, -0.016823578625917435, -0...
722,676
stackprinter.tracing
enable
null
def enable(self, force=False, current_depth=None): if current_depth is None: current_depth = count_stack(sys._getframe(1)) self.starting_depth = current_depth self.previous_frame = None self.trace_before = sys.gettrace() if (self.trace_before is not None) and not force: raise Excepti...
(self, force=False, current_depth=None)
[ 0.034130681306123734, 0.016977375373244286, 0.01443516742438078, 0.051442328840494156, -0.02561560459434986, 0.015464366413652897, -0.052568286657333374, 0.01968671940267086, 0.021533997729420662, -0.03029537945985794, 0.01710052788257599, -0.09683261811733246, -0.015912991017103195, -0.03...