_get/set_params into parameterized

This commit is contained in:
Max Zwiessele 2013-06-26 17:04:10 +01:00
parent d978d3e390
commit 146dff7cbf
2 changed files with 5 additions and 4 deletions

View file

@ -23,10 +23,6 @@ class Model(Parameterized):
self.sampling_runs = [] self.sampling_runs = []
self.preferred_optimizer = 'scg' self.preferred_optimizer = 'scg'
# self._set_params(self._get_params()) has been taken out as it should only be called on leaf nodes # self._set_params(self._get_params()) has been taken out as it should only be called on leaf nodes
def _get_params(self):
raise NotImplementedError, "this needs to be implemented to use the Model class"
def _set_params(self, x):
raise NotImplementedError, "this needs to be implemented to use the Model class"
def log_likelihood(self): def log_likelihood(self):
raise NotImplementedError, "this needs to be implemented to use the Model class" raise NotImplementedError, "this needs to be implemented to use the Model class"
def _log_likelihood_gradients(self): def _log_likelihood_gradients(self):

View file

@ -20,6 +20,11 @@ class Parameterized(object):
self.constrained_indices = [] self.constrained_indices = []
self.constraints = [] self.constraints = []
def _get_params(self):
raise NotImplementedError, "this needs to be implemented to use the Model class"
def _set_params(self, x):
raise NotImplementedError, "this needs to be implemented to use the Model class"
def pickle(self, filename, protocol=None): def pickle(self, filename, protocol=None):
if protocol is None: if protocol is None:
if self._has_get_set_state(): if self._has_get_set_state():