From patchwork Wed May 12 18:44:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubhanshu Saxena X-Patchwork-Id: 27728 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:b214:0:0:0:0:0 with SMTP id b20csp5305696iof; Wed, 12 May 2021 12:17:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwew/2orJ3M5b2SDs4qwD4xBbutB54FLAPVsGsXQjMvcN0qiduNodg8Dp8EE4uy3LDMW1Zp X-Received: by 2002:a05:6402:2283:: with SMTP id cw3mr45017749edb.122.1620847071805; Wed, 12 May 2021 12:17:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620847071; cv=none; d=google.com; s=arc-20160816; b=0p77LzXZIQEmrTSFCGuUwPjIkSTMJrLLi2db45ZtH0TBsfAMFruypvj1MAx0xmSImy sW3BUOwSpKr/l9WQrOZ2kgASqNSXAJnWS9kcP316ffBaiYVDBYZVFYXrriLWbK0IslpL u7wXUKE9v4Hqw57L5aqd5NYaDswTwB1ZPx5mFvMll8WY4mlnMl/WSfmbrW38V/fVT0On cu2mL0FtKgR0UgfhUQGMV9co8bSTQNUD7n/XmuRgx/uRElnqb+QFMi6O3BuOWiYmwurd XRJjCfUbgHrYIVNTqmLIjVKPNXSjAvZmrK707Z7mv0c3OpfgjwsPgHwkzYTh4Axo9ioY xa4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=YSij184ceYS5oY/zyFSMbJqJdA0HJaGR4958BDTdF5s=; b=I4pjblSPwcWeZUqsicVBsnTMIUOCtoEH1hDtgBN4lc92nJP6qld/oEgYo52u6Wmgc+ mNGXhnVyLHKMgUBvSt32X6OXTfTtmFgCcyB/diEYaw76OD7Ub02eDg6WoDnCJxJdtef0 pBfa8kBPpSAbM3aXTYgN1PPmfNvm5K3Jta4XTPK+zW4ZO17kLrFfwrSWRJmnERTv5/nB U53vwUz/EEEYXcS5AzLIosP5FkhHr5nzcF3WUXir7HS8+vZifZH8Ubost46m0lUe5Ptr r3VZb6DajpC13GucZzdHeKJX9RARvgqYpnN8NrbmlT3RVqlZRtm+CodPX0TUVZDnKcgv Yz2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=Apzf5Zfm; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id a4si64332ejy.359.2021.05.12.12.17.51; Wed, 12 May 2021 12:17:51 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=Apzf5Zfm; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id AA35F68809B; Wed, 12 May 2021 22:17:49 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A1306687F43 for ; Wed, 12 May 2021 22:17:43 +0300 (EEST) Received: by mail-pg1-f173.google.com with SMTP id q15so14695527pgg.12 for ; Wed, 12 May 2021 12:17:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=C9AUNDNMEYvbu9RP2NXT9ebaqxtJUGm6wz4E+zhwIEQ=; b=Apzf5Zfms7KisqtXp8GRjilE8TO58lsSzTTTD4lGocAvxbJQ4xhwRlcqiOkMxk9KMy UlTF4wWBoHIpHourNz56M8YLibr2StRfDVGCSnWEYSQJg/PMsneREvK6JSVDnrlcgf+J SgpuV5284aFjtPt+kVTrGijJEtDDjzLsbVMq2/Ew/Ann0kWGRNK2DgKvZWsHPQGAHiK+ YQGQE7ycteC2KcoIzKjs/dMfiQnY2ENycoKm4HeI2y+pf8JHoozpnHbe/94Qkz29XpQf nR7EIZpU6jCANUiZCcxdhOI7ZTgJRm9g1ttOjvCeL/ywpfyN5R95MNfOvI4O2j68eIw2 M45g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=C9AUNDNMEYvbu9RP2NXT9ebaqxtJUGm6wz4E+zhwIEQ=; b=piYqywFjsJ+ImIX9YOjyoE1V4tgWXCYZG9y/oPWknP8di+lx+q4ut5AHyqAMMnHzjY aJC3d7FOWCs4s+WPnsJRmNlzKH9KK/sZqkdu5WfTFQLK35rAQMIHku5GCRj4d2KGz1x4 c+czeonWXTEO6VdKHJ/d7iv+jQybABgdOLauvMPwuzZKeuSfDJwVFNzr5f8g2e9X7km3 +C6XgIQjdYoaPqUNqCU4W+UnbTp62gk5H7RgP/CFU8RRSf6gbWRmkogsH/prBnyFblwt 7HjztPhoDsYZl63UEaaGnPjaxCp4ltDTCeoi/eWRKV/gD3DINMDgdPn+CzRZGxy/tEpD LHcQ== X-Gm-Message-State: AOAM533EY1p5WskxiNBoJlEDo846mVnYYtiMjualp347cNq4n+LcYdL3 VGxTEAJVFe6NDAjdHfwILyuMblh7HVeyIA== X-Received: by 2002:a17:902:6504:b029:ee:d332:4bd6 with SMTP id b4-20020a1709026504b02900eed3324bd6mr36790718plk.37.1620845157005; Wed, 12 May 2021 11:45:57 -0700 (PDT) Received: from Pavilion-x360.bbrouter ([103.133.123.78]) by smtp.googlemail.com with ESMTPSA id js6sm4866120pjb.0.2021.05.12.11.45.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 May 2021 11:45:56 -0700 (PDT) From: Shubhanshu Saxena To: ffmpeg-devel@ffmpeg.org Date: Thu, 13 May 2021 00:14:40 +0530 Message-Id: <20210512184439.30591-3-shubhanshu.e01@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210512184439.30591-1-shubhanshu.e01@gmail.com> References: <20210512184439.30591-1-shubhanshu.e01@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/5 v2] lavfi/dnn_backend_native_layer_dense.h: Documentation X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Shubhanshu Saxena Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: tcyA8bKf+DaF Add documentation for Dense Layer Signed-off-by: Shubhanshu Saxena --- .../dnn/dnn_backend_native_layer_dense.h | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/libavfilter/dnn/dnn_backend_native_layer_dense.h b/libavfilter/dnn/dnn_backend_native_layer_dense.h index 86248856ae..83fcb18831 100644 --- a/libavfilter/dnn/dnn_backend_native_layer_dense.h +++ b/libavfilter/dnn/dnn_backend_native_layer_dense.h @@ -31,7 +31,35 @@ typedef struct DenseParams{ float *biases; } DenseParams; +/** + * @brief Load the Densely-Connnected Layer. + * + * It assigns the layer parameters to the hyperparameters + * like activation, bias, and kernel size after parsing + * from the model file context. + * + * @param layer pointer to the DNN layer instance + * @param model_file_context pointer to model file context + * @param file_size model file size to check if data is read + * correctly from the model file + * @param operands_num operand count of the whole model to + * check if data is read correctly from the model file + * @return number of bytes read from the model file + * @retval 0 if out of memory or an error occurs + */ int ff_dnn_load_layer_dense(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num); + +/** + * @brief Execute the Densely-Connnected Layer. + * + * @param operands all operands for the model + * @param input_operand_indexes input operand indexes for this layer + * @param output_operand_index output operand index for this layer + * @param parameters average pooling parameters + * @param ctx pointer to Native model context for logging + * @retval 0 if the execution succeeds + * @retval DNN_ERROR if the execution fails + */ int ff_dnn_execute_layer_dense(DnnOperand *operands, const int32_t *input_operand_indexes, int32_t output_operand_index, const void *parameters, NativeContext *ctx); #endif