ArgMax
Input
x:
- Required: yes
- Type: fp32, fp16
- Description: input tensor
- Restriction: none
Attribute
- axis:
- Required: no
- Type: int
- Description: axis to be reduced in the input tensor. If this parameter is not provided, top_k is calculated per batch.
- Restriction: none
- out_max_val:
- Required: no
- Type: bool
- Description: whether to output the maximum value.
- If out_max_val is True and there are two top blobs:
- If axis is specified, only the maximum value of each axis is output.
- If axis is not specified, the index of the maximum value and the maximum value are output.
layer { name: "argmax" type: "ArgMax" bottom: "data" top: "indices" top: "values" argmax_param { out_max_val: True top_k: 1 } - If out_max_val is True and there is one top, the maximum value is output.
layer { name: "argmax" type: "ArgMax" bottom: "data" top: "values" argmax_param { out_max_val: True top_k: 1 axis: 1 } } - If out_max_val is False, the maximum index of each axis is output.
layer { name: "argmax" type: "ArgMax" bottom: "data" top: "indices" argmax_param { out_max_val: False top_k: 1 axis: 1 } }
- If out_max_val is True and there are two top blobs:
- Restriction: none
- top_k:
- Required: no
- Type: int
- Description: defaults to 1, indicating the top_k in each axis. The value range is [1, x.shape(axis)], corresponding to top_k in Caffe.
- Restriction: Must be 1.
Output
- indices:
- Required: no
- Type: int32
- Description: index of the maximum output value
- Restriction: none
- values:
- Required: no
- Type: fp32, fp16
- Description: output tensor, including the maximum value index or maximum value
- Restriction: none
Parent topic: Supported Caffe Operators