예제 #1
0
def softmax(node, axes, name=None):  # type: (Node, Iterable[int], str) -> Node
    """Apply softmax operation on each element of input tensor.

    :param node: The tensor providing input data.
    :param axes: The list of axes indices which are used to calculate divider of
                 the softmax function.
    :param name: The optional new name for output node.
    :return: The new node with softmax operation applied on each element.
    """
    if type(axes) is not set:
        axes = set(axes)
    return Softmax(node, AxisSet(axes))
예제 #2
0
파일: ops.py 프로젝트: jrmwng/ngraph
def softmax(node, axes):  # type: (Node, Iterable[int]) -> Node
    """Softmax operation on input tensor."""
    if type(axes) is not set:
        axes = set(axes)
    return Softmax(node, AxisSet(axes))