mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-04-27 13:56:23 +02:00
[parameter core] offset for can be done without parameter slices
This commit is contained in:
parent
6fc982faa0
commit
2de4b92c38
1 changed files with 3 additions and 2 deletions
|
|
@ -372,8 +372,9 @@ class Indexable(Nameable, Observable):
|
||||||
basically just sums up the parameter sizes which come before param.
|
basically just sums up the parameter sizes which come before param.
|
||||||
"""
|
"""
|
||||||
if param.has_parent():
|
if param.has_parent():
|
||||||
if param._parent_._get_original(param) in self.parameters:
|
p = param._parent_._get_original(param)
|
||||||
return self._param_slices_[param._parent_._get_original(param)._parent_index_].start
|
if p in self.parameters:
|
||||||
|
return reduce(lambda a,b: a + b.size, self.parameters[:p._parent_index_], 0)
|
||||||
return self._offset_for(param._parent_) + param._parent_._offset_for(param)
|
return self._offset_for(param._parent_) + param._parent_._offset_for(param)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue