@@ -306,7 +306,7 @@ def hinge_loss(pred: Tensor, label: Tensor, norm: str = "L1") -> Tensor: | |||||
The hinge loss can be described as: | The hinge loss can be described as: | ||||
.. math:: loss(x, y) = \frac{1}{N}\sum_i\sum_j(max(0, 1 - x_i_j*y_i_j)) | |||||
.. math:: loss(x, y) = \frac{1}{N}\sum_i\sum_j(max(0, 1 - x_{ij}*y_{ij})) | |||||
:param pred: The input tensor representing the predicted probability, shape is (N, C). | :param pred: The input tensor representing the predicted probability, shape is (N, C). | ||||
:param label: The input tensor representing the binary classification label, shape is (N, C). | :param label: The input tensor representing the binary classification label, shape is (N, C). | ||||
@@ -47,10 +47,6 @@ def conv_bias_activation( | |||||
'CROSS_CORRELATION'. | 'CROSS_CORRELATION'. | ||||
:param dtype: Support for np.dtype, Default: | :param dtype: Support for np.dtype, Default: | ||||
np.int8. | np.int8. | ||||
:param scale: scale if use quantization, Default: | |||||
0.0. | |||||
:param zero_point: scale if use quantization quint8, Default: | |||||
0.0. | |||||
:type compute_mode: string or | :type compute_mode: string or | ||||
:class:`mgb.opr_param_defs.Convolution.ComputeMode` | :class:`mgb.opr_param_defs.Convolution.ComputeMode` | ||||
:param compute_mode: When set to 'DEFAULT', no special requirements will be | :param compute_mode: When set to 'DEFAULT', no special requirements will be | ||||
@@ -216,6 +216,7 @@ class BatchNorm2d(_BatchNorm): | |||||
.. testcode:: | .. testcode:: | ||||
import numpy as np | |||||
import megengine as mge | import megengine as mge | ||||
import megengine.module as M | import megengine.module as M | ||||
@@ -13,7 +13,7 @@ echo "EXTRA_CMAKE_ARGS: ${EXTRA_CMAKE_ARGS}" | |||||
function usage() { | function usage() { | ||||
echo "$0 args1 args2 .." | echo "$0 args1 args2 .." | ||||
echo "available args detail:" | echo "available args detail:" | ||||
echo "-d : Build with Debug mode, defaule Release mode" | |||||
echo "-d : Build with Debug mode, default Release mode" | |||||
echo "-f : enable MGE_ARMV8_2_FEATURE_FP16 for ARM64, need toolchain and hardware support" | echo "-f : enable MGE_ARMV8_2_FEATURE_FP16 for ARM64, need toolchain and hardware support" | ||||
echo "-p : enable MGE_ARMV8_2_FEATURE_DOTPROD for ARM64, need toolchain and hardware support" | echo "-p : enable MGE_ARMV8_2_FEATURE_DOTPROD for ARM64, need toolchain and hardware support" | ||||
echo "-k : open MGE_DISABLE_FLOAT16 for NEON " | echo "-k : open MGE_DISABLE_FLOAT16 for NEON " | ||||
@@ -13,7 +13,7 @@ echo "EXTRA_CMAKE_ARGS: ${EXTRA_CMAKE_ARGS}" | |||||
function usage() { | function usage() { | ||||
echo "$0 args1 args2 .." | echo "$0 args1 args2 .." | ||||
echo "available args detail:" | echo "available args detail:" | ||||
echo "-d : Build with Debug mode, defaule Release mode" | |||||
echo "-d : Build with Debug mode, default Release mode" | |||||
echo "-f : enable MGE_ARMV8_2_FEATURE_FP16 for ARM64, need toolchain and hardware support" | echo "-f : enable MGE_ARMV8_2_FEATURE_FP16 for ARM64, need toolchain and hardware support" | ||||
echo "-p : enable MGE_ARMV8_2_FEATURE_DOTPROD for ARM64, need toolchain and hardware support" | echo "-p : enable MGE_ARMV8_2_FEATURE_DOTPROD for ARM64, need toolchain and hardware support" | ||||
echo "-k : open MGE_DISABLE_FLOAT16 for NEON " | echo "-k : open MGE_DISABLE_FLOAT16 for NEON " | ||||
@@ -13,7 +13,7 @@ echo "EXTRA_CMAKE_ARGS: ${EXTRA_CMAKE_ARGS}" | |||||
function usage() { | function usage() { | ||||
echo "$0 args1 args2 .." | echo "$0 args1 args2 .." | ||||
echo "available args detail:" | echo "available args detail:" | ||||
echo "-d : Build with Debug mode, defaule Release mode" | |||||
echo "-d : Build with Debug mode, default Release mode" | |||||
echo "-f : enable MGE_ARMV8_2_FEATURE_FP16 for ARM64, need toolchain and hardware support" | echo "-f : enable MGE_ARMV8_2_FEATURE_FP16 for ARM64, need toolchain and hardware support" | ||||
echo "-p : enable MGE_ARMV8_2_FEATURE_DOTPROD for ARM64, need toolchain and hardware support" | echo "-p : enable MGE_ARMV8_2_FEATURE_DOTPROD for ARM64, need toolchain and hardware support" | ||||
echo "-k : open MGE_DISABLE_FLOAT16 for NEON " | echo "-k : open MGE_DISABLE_FLOAT16 for NEON " | ||||
@@ -4,7 +4,7 @@ set -e | |||||
function usage() { | function usage() { | ||||
echo "$0 args1 args2 .." | echo "$0 args1 args2 .." | ||||
echo "available args detail:" | echo "available args detail:" | ||||
echo "-d : Build with Debug mode, defaule Release mode" | |||||
echo "-d : Build with Debug mode, default Release mode" | |||||
echo "-c : Build with CUDA, default without CUDA" | echo "-c : Build with CUDA, default without CUDA" | ||||
echo "-t : Build with training mode, default inference only" | echo "-t : Build with training mode, default inference only" | ||||
echo "-m : Build with m32 mode(only for windows build), default m64" | echo "-m : Build with m32 mode(only for windows build), default m64" | ||||