You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2017/11/08 09:23:24 UTC

[GitHub] KellenSunderland commented on a change in pull request #8582: Yolo2 operator

KellenSunderland commented on a change in pull request #8582: Yolo2 operator
URL: https://github.com/apache/incubator-mxnet/pull/8582#discussion_r149613155
 
 

 ##########
 File path: src/operator/contrib/yolo_output-inl.h
 ##########
 @@ -0,0 +1,702 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/*!
+ * \file yolo_output-inl.h
+ * \brief yolo-v2 output layer
+ * \author Joshua Zhang
+*/
+#ifndef MXNET_OPERATOR_CONTRIB_YOLO_OUTPUT_INL_H_
+#define MXNET_OPERATOR_CONTRIB_YOLO_OUTPUT_INL_H_
+#include <dmlc/logging.h>
+#include <dmlc/parameter.h>
+#include <mxnet/operator.h>
+#include <mxnet/base.h>
+#include <nnvm/tuple.h>
+#include <map>
+#include <vector>
+#include <string>
+#include <algorithm>
+#include <utility>
+#include "../operator_common.h"
+#include "../mshadow_op.h"
+#include "../mxnet_op.h"
+
+namespace mxnet {
+namespace op {
+namespace yoloout_enum {
+enum YoloOutputOpInputs {kData, kLabel};
+enum YoloOutputOpOutputs {kOut, kTemp, kCopy};
+enum YoloOutputOpAuxiliary {kCounter};
+enum YoloOutputOpResource {kTempSpace};
+}  // namespace yoloout_enum
+
+struct YoloOutputParam : public dmlc::Parameter<YoloOutputParam> {
+  int num_class;
+  int num_anchor;
+  float overlap_thresh;
+  float object_grad_scale;
+  float background_grad_scale;
+  float class_grad_scale;
+  float coord_grad_scale;
+  nnvm::Tuple<float> anchors;
+  int warmup_samples;
+  float warmup_grad_scale;
+  float nms_threshold;
+  int nms_topk;
+  bool force_suppress;
+  DMLC_DECLARE_PARAMETER(YoloOutputParam) {
+    DMLC_DECLARE_FIELD(num_class).set_lower_bound(1)
+    .describe("Number of object classes.");
+    DMLC_DECLARE_FIELD(num_anchor).set_default(5)
+    .set_lower_bound(1)
+    .describe("Number of anchors.");
+    DMLC_DECLARE_FIELD(overlap_thresh).set_default(0.6)
+    .describe("Positive overlap threshold.");
+    DMLC_DECLARE_FIELD(object_grad_scale).set_default(1.0)
+    .describe("Gradient scale for positive objects.");
+    DMLC_DECLARE_FIELD(background_grad_scale).set_default(1.0)
+    .describe("Gradient scale for background.");
+    DMLC_DECLARE_FIELD(class_grad_scale).set_default(1.0)
+    .describe("Gradient scale for positive objects.");
+    DMLC_DECLARE_FIELD(coord_grad_scale).set_default(1.0)
+    .describe("Gradient scale for box offsets.");
+    DMLC_DECLARE_FIELD(anchors)
+    .set_default({1.08, 1.19, 3.42, 4.41, 6.63, 11.38, 9.42, 5.11, 16.62, 10.52})
+    .describe("Predefined anchor box widths and heights.");
+    DMLC_DECLARE_FIELD(warmup_samples).set_default(12800)
+    .describe("Number of images to warm up towards averaging position for box "
+    "predictions when start a new training. ");
 
 Review comment:
   Small grammar tweak:
   ```Number of images to warm up towards averaging position for box predictions when starting a new training.```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services