Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Update documentation for mxnet.ndarray.GridGenerator. #6430

Merged
merged 4 commits into from
May 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/operator/grid_generator-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ struct GridGeneratorParam : public dmlc::Parameter<GridGeneratorParam> {
DMLC_DECLARE_FIELD(transform_type)
.add_enum("affine", grid::kAffine)
.add_enum("warp", grid::kWarp)
.describe("transformation type\n "
"if transformation type is affine, data is affine matrix : (batch, 6)\n "
"if transformation type is warp, data is optical flow : (batch, 2, h, w)");
.describe("The type of transformation. For `affine`, input data should be an affine matrix "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still hard to understand. What's affine matrix? what's optical flow?

Copy link
Contributor

@Lyken17 Lyken17 May 25, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I here assume reader has backgrounds about common matrices.
I will attach more description for affine transform , but as for optical flow, detailed explanation can take pages, personally prefer a link to wiki.

"of size (batch, 6). For `warp`, input data should be an optical flow of size "
"(batch, 2, h, w).");
DMLC_DECLARE_FIELD(target_shape).set_default(TShape(shape, shape + 2))
.describe("if transformation type is affine, the operator need a target_shape : (H, W)\n "
"if transofrmation type is warp, the operator will ignore target_shape");
.describe("Specifies the output shape (H, W). This is required if transformation type is "
"`affine`. If transformation type is `warp`, this parameter is ignored.");
}
};

Expand Down
6 changes: 2 additions & 4 deletions src/operator/grid_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,9 @@ Operator *GridGeneratorProp::CreateOperatorEx(Context ctx, std::vector<TShape> *
DMLC_REGISTER_PARAMETER(GridGeneratorParam);

MXNET_REGISTER_OP_PROPERTY(GridGenerator, GridGeneratorProp)
.add_argument("data", "NDArray-or-Symbol", "Input data to the GridGeneratorOp.")
.describe("if transformation type is affine, data is affine matrix : (batch, 6)")
.describe("if transformation type is warp, data is optical flow : (batch, 2, h, w)")
.add_argument("data", "NDArray-or-Symbol", "Input data to the function.")
.add_arguments(GridGeneratorParam::__FIELDS__())
.describe("Generates sampling grid for bilinear sampling.");
.describe("Generates 2D sampling grid for bilinear sampling.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explain more. Link to the paper. explain what this op is for & how it should be used.


} // namespace op
} // namespace mxnet