mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-13 05:52:38 +02:00
Merge branch 'hmc' into devel
A HMC sampler for GP parameters
This commit is contained in:
commit
98d91e6db2
3 changed files with 177 additions and 0 deletions
|
|
@ -862,6 +862,25 @@ class Parameterizable(OptimizationHandlable):
|
|||
self._param_array_ = np.empty(self.size, dtype=np.float64)
|
||||
return self._param_array_
|
||||
|
||||
@property
|
||||
def unfixed_param_array(self):
|
||||
"""
|
||||
Array representing the parameters of this class.
|
||||
There is only one copy of all parameters in memory, two during optimization.
|
||||
|
||||
!WARNING!: setting the parameter array MUST always be done in memory:
|
||||
m.param_array[:] = m_copy.param_array
|
||||
"""
|
||||
if self.__dict__.get('_param_array_', None) is None:
|
||||
self._param_array_ = np.empty(self.size, dtype=np.float64)
|
||||
|
||||
if self.constraints[__fixed__].size !=0:
|
||||
fixes = np.ones(self.size).astype(bool)
|
||||
fixes[self.constraints[__fixed__]] = FIXED
|
||||
return self._param_array_[fixes]
|
||||
else:
|
||||
return self._param_array_
|
||||
|
||||
@param_array.setter
|
||||
def param_array(self, arr):
|
||||
self._param_array_ = arr
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue