Compute the discrete time derivative of the input using backward difference approximation:
dx(n) = x(n) - x(n-1), where n is the total number of input samples observed during training.
This is an online learnable node that uses a buffer to store the previous input sample = x(n-1). The node's train
method updates the buffer. The node's execute method returns the time difference using the stored buffer
as its previous input sample x(n-1).
This node supports both "incremental" and "batch" training types.
|
|
__init__(self,
input_dim=None,
output_dim=None,
dtype=None,
numx_rng=None)
Initializes an object of type 'OnlineTimeDiffNode'. |
|
|
|
|
|
|
|
_execute(self,
x)
Returns the time difference. |
|
|
|
|
_train(self,
x)
Update the buffer. |
|
|
|
numpy.ndarray
|
execute(self,
x)
Returns the time difference. |
|
|
|
|
train(self,
x)
Update the buffer. |
|
|
|
Inherited from unreachable.newobject:
__long__,
__native__,
__nonzero__,
__unicode__,
next
Inherited from object:
__delattr__,
__format__,
__getattribute__,
__hash__,
__new__,
__reduce__,
__reduce_ex__,
__setattr__,
__sizeof__,
__subclasshook__
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_pre_execution_checks(self,
x)
This method contains all pre-execution checks.
It can be used when a subclass defines multiple execution methods. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__call__(self,
x,
*args,
**kwargs)
Calling an instance of Node is equivalent to calling
its execute method. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_refcast(self,
x)
Helper function to cast arrays to the internal dtype. |
|
|
|
|
|
|
|
|
|
|
copy(self,
protocol=None)
Return a deep copy of the node. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inverse(self,
y,
*args,
**kwargs)
Invert y. |
|
|
|
|
is_training(self)
Return True if the node is in the training phase,
False otherwise. |
|
|
|
|
save(self,
filename,
protocol=-1)
Save a pickled serialization of the node to filename.
If filename is None, return a string. |
|
|
|
|
set_dtype(self,
t)
Set internal structures' dtype. |
|
|
|
|
|
|
|
|