Offset#
- class Offset(input=None, offset=0, index=0, **kwargs)[source]#
Bases:
objectA class for adding a scalar to one element of an input array. In practice, this can be used to “shift” or “offset” the “value” of one particular stimulus, for example to represent a consistent bias for (or against) that stimulus.
- Parameters:
- inputarray_like
The input value. The stimulus representation (vector).
- offset
float The value to be added to one element of the input.
- index
int The index of the element of the input vector to which the offset should be added.
- **kwargs
dict, optional Additional keyword arguments.
Examples
>>> vals = np.array([2.1, 1.1]) >>> offsetter = Offset(input = vals, offset = 1.33, index = 0) >>> offsetter.compute() array([3.43, 1.1])