You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by ya...@apache.org on 2017/11/14 13:28:37 UTC

[incubator-mxnet] branch vision updated: add stub (#8650)

This is an automated email from the ASF dual-hosted git repository.

yajiedesign pushed a commit to branch vision
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/vision by this push:
     new f7faf9b  add stub (#8650)
f7faf9b is described below

commit f7faf9ba62d2817b5edd107902c0b9cdbdb8bb2a
Author: Hu Shiwen <ya...@gmail.com>
AuthorDate: Tue Nov 14 21:28:34 2017 +0800

    add stub (#8650)
    
    * add stub
---
 src/operator/image/image_random-inl.h | 79 +++++++++++++++++++++++++++++++----
 1 file changed, 72 insertions(+), 7 deletions(-)

diff --git a/src/operator/image/image_random-inl.h b/src/operator/image/image_random-inl.h
index 9506607..1281a71 100644
--- a/src/operator/image/image_random-inl.h
+++ b/src/operator/image/image_random-inl.h
@@ -35,17 +35,41 @@
 
 namespace mxnet {
 namespace op {
+
+
+enum ImageRandomResource { kRandom };
+
+template<typename xpu>
+static void RandomFlip(const nnvm::NodeAttrs &attrs,
+  const OpContext &ctx,
+  const std::vector<TBlob> &inputs,
+  const std::vector<OpReqType> &req,
+  const std::vector<TBlob> &outputs) {
+}
+template<typename xpu>
+static void ToTensor(const nnvm::NodeAttrs &attrs,
+  const OpContext &ctx,
+  const std::vector<TBlob> &inputs,
+  const std::vector<OpReqType> &req,
+  const std::vector<TBlob> &outputs) {
+}
+template<typename xpu>
+static void Normalize(const nnvm::NodeAttrs &attrs,
+  const OpContext &ctx,
+  const std::vector<TBlob> &inputs,
+  const std::vector<OpReqType> &req,
+  const std::vector<TBlob> &outputs) {
+}
+
 struct RandomBrightnessParam : public dmlc::Parameter<RandomBrightnessParam> {
   float max_brightness;
   DMLC_DECLARE_PARAMETER(RandomBrightnessParam) {
     DMLC_DECLARE_FIELD(max_brightness)
-    .set_default(0.0)
-    .describe("Max Contrast.");
+      .set_default(0.0)
+      .describe("Max Brightness.");
   }
 };
 
-enum ImageRandomResource { kRandom };
-
 template<typename xpu>
 static void RandomBrightness(const nnvm::NodeAttrs &attrs,
                              const OpContext &ctx,
@@ -72,6 +96,14 @@ static void RandomBrightness(const nnvm::NodeAttrs &attrs,
 
 }
 
+struct RandomContrastParam : public dmlc::Parameter<RandomContrastParam> {
+  float max_contrast;
+  DMLC_DECLARE_PARAMETER(RandomContrastParam) {
+    DMLC_DECLARE_FIELD(max_contrast)
+      .set_default(0.0)
+      .describe("Max Contrast.");
+  }
+};
 
 /*! \brief mul_add operator */
 struct mul_add {
@@ -82,7 +114,6 @@ struct mul_add {
   }
 };
 
-
 template<typename xpu>
 static void RandomContrast(const nnvm::NodeAttrs &attrs,
                            const OpContext &ctx,
@@ -99,8 +130,8 @@ static void RandomContrast(const nnvm::NodeAttrs &attrs,
   Random<xpu> *prnd = ctx.requested[kRandom].get_random<xpu, real_t>(s);
 
 
-  const RandomBrightnessParam &param = nnvm::get<RandomBrightnessParam>(attrs.parsed);
-  float alpha_c = 1.0 + std::uniform_real_distribution<float>(-param.max_brightness, param.max_brightness)(prnd->GetRndEngine());
+  const RandomContrastParam &param = nnvm::get<RandomContrastParam>(attrs.parsed);
+  float alpha_c = 1.0 + std::uniform_real_distribution<float>(-param.max_contrast, param.max_contrast)(prnd->GetRndEngine());
 
   const float R2YF = 0.299f;
   const float G2YF = 0.587f;
@@ -129,6 +160,40 @@ static void RandomContrast(const nnvm::NodeAttrs &attrs,
 
 }
 
+template<typename xpu>
+static void RandomSaturation(const nnvm::NodeAttrs &attrs,
+  const OpContext &ctx,
+  const std::vector<TBlob> &inputs,
+  const std::vector<OpReqType> &req,
+  const std::vector<TBlob> &outputs) {
+}
+
+template<typename xpu>
+static void RandomHue(const nnvm::NodeAttrs &attrs,
+  const OpContext &ctx,
+  const std::vector<TBlob> &inputs,
+  const std::vector<OpReqType> &req,
+  const std::vector<TBlob> &outputs) {
+}
+
+template<typename xpu>
+static void RandomColorJitter(const nnvm::NodeAttrs &attrs,
+  const OpContext &ctx,
+  const std::vector<TBlob> &inputs,
+  const std::vector<OpReqType> &req,
+  const std::vector<TBlob> &outputs) {
+}
+
+template<typename xpu>
+static void RandomLighting(const nnvm::NodeAttrs &attrs,
+  const OpContext &ctx,
+  const std::vector<TBlob> &inputs,
+  const std::vector<OpReqType> &req,
+  const std::vector<TBlob> &outputs) {
+}
+
+
+
 
 } // namespace op
 } // namespace mxnet

-- 
To stop receiving notification emails like this one, please contact
['"commits@mxnet.apache.org" <co...@mxnet.apache.org>'].