operator
Binary Numpy function used to combine the individual patterns.
Any binary Numpy array "ufunc" returning the same
type of array as the operands and supporting the reduce
operator is allowed here. Supported ufuncs include:
add
subtract
multiply
divide
maximum
minimum
remainder
power
logical_and
logical_or
logical_xor
The most useful ones are probably add and maximum, but there
are uses for at least some of the others as well (e.g. to
remove pieces of other patterns).
You can also write your own operators, by making a class that
has a static method named "reduce" that returns an array of the
same size and type as the arrays in the list. For example:
class return_first(object):
@staticmethod
def reduce(x):
return x[0]
- Value:
param.Parameter(numpy.maximum, precedence= 0.98, doc= """
Binary Numpy function used to combine the individual patterns.
Any binary Numpy array "ufunc" returning the same
type of array as the operands and supporting the reduce
operator is allowed here. Supported ufuncs include::
add
...
|
|