def METHOD_NAME(define_dict):
    loss_fn_dict = dict(inspect.getmembers(nn))
    if 'loss_fn' not in define_dict:
        raise ValueError('please specify loss function in the json config')
    param_dict = copy.deepcopy(define_dict)
    param_dict.pop('loss_fn')
    if define_dict['loss_fn'] == CustLoss.__name__:
        return CustLoss(loss_module_name=param_dict['loss_module_name'],
                        class_name=param_dict['class_name'],
                        **param_dict['param']).get_pytorch_model()
    else:
        return loss_fn_dict[define_dict['loss_fn']](**param_dict)