You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the signature of optimizers only allows the following:
def __init__(self, wrt, f, ...):
# ...
However, in some cases, this can lead to problems with the GPU: e.g. theano does not guarantee that changing shared variables (e.g. retrieved with borrow=True) will actually change the real thing in the background.
I therefore suggest to add the following behaviour:
def __init__(self, wrt, f, ...):
if isinstance(wrt, tuple):
self._get_wrt, self._set_wrt = wrt
else:
# the old methods from below work for the array
self._wrt = wrt
def _get_wrt(self): return self._wrt
def _set_wrt(self, val): self._wrt[:] = val
The downside is that we will lose some inplace operations. But I am not too sure whether that is actually the case.
The text was updated successfully, but these errors were encountered:
Currently, the signature of optimizers only allows the following:
def init(self, wrt, f, ...):
# ...
However, in some cases, this can lead to problems with the GPU: e.g. theano does not guarantee that changing shared variables (e.g. retrieved with borrow=True) will actually change the real thing in the background.
I therefore suggest to add the following behaviour:
def init(self, wrt, f, ...):
if isinstance(wrt, tuple):
self._get_wrt, self._set_wrt = wrt
else:
# the old methods from below work for the array
self._wrt = wrt
def _get_wrt(self): return self._wrt
def _set_wrt(self, val): self._wrt[:] = val
The downside is that we will lose some inplace operations. But I am not too sure whether that is actually the case.
Reply to this email directly or view it on GitHub: #1
Patrick van der Smagt - DLR, Institute of Robotics and Mechatronics
P.O. Box 1116, 82230 Wessling, Germany - ph +49 8153 281152 - brml.de
Currently, the signature of optimizers only allows the following:
However, in some cases, this can lead to problems with the GPU: e.g. theano does not guarantee that changing shared variables (e.g. retrieved with
borrow=True
) will actually change the real thing in the background.I therefore suggest to add the following behaviour:
The downside is that we will lose some inplace operations. But I am not too sure whether that is actually the case.
The text was updated successfully, but these errors were encountered: