-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Paddle Function #892
Comments
Reorganize the code Reorganize the code in order to make these computational functions more readable and easy to test.
One of the obvious drawbacks of the original code structure is that the |
Function Interface According to the issues of a unified function interface description, the simplest form of the interface should be based on one input to calculate one output.
In order to support multiple inputs and multiple outputs, the interface form needs to be slightly modified.
In order to enable the calculation result to be assigned to the output or to be added to the output, the interface needs to be designed to support both modes.
|
FAQ
|
Function Argument Type Paddle中Function的参数类型主要有以下四种;
|
A new design (#892 (comment)) ---------------------- obsolete-------------------------------
其中
|
@hedaoyuan , 对于1 MixedLayer, 为什么要用inouts, 这里的output是Assign还是Add?能否给个小例子? |
MixedLayer只链接一个inputLayer到output,则只需要output = Function(input); |
我大概明白了。
…On Sun, Jan 8, 2017 at 6:33 PM, hedaoyuan ***@***.***> wrote:
MixedLayer只链接一个inputLayer到output,则只需要output = Function(input);
如果连接多个,并对应多个Function则需要:
output = Function1(input1);
output += Function2(input2);
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#892 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AVN-KGJ_IzC24Nr-CVa7XCXgjVHCvw9yks5rQZyXgaJpZM4LMyLs>
.
|
Some Primary Commit
Function prototype
|
Function comments Function是Paddle Computation的抽象,被其他模块(Layer,ParameterUpdate等)调用,所以每个Function需要有清晰的注释,包括具体的实现,输入输出参数类型,以及Function对于output参数(ASSIGN_TO/ADD_TO)的支持等;注释的目的是能够让使用者不必阅读具体代码也能明白Function的实现逻辑并正确的调用。 一些基本的Function注释方法:
|
* split layers,test=develop * split nn layers * remove nn header, test=develop
* polish distill
The main purpose of refactoring Paddle's computationally related code is to use a unified interface to represent each function. The function here can be understood as an operator in a neural network. Refactoring these computationally related codes mainly to solve the following three issues.
In Paddle, the definition of Layer has a unified interface, but a Layer often call a number of functions, these functions do not have a unified interface description.
If I just want to write an FFT-based convolution forward calculation for model inference, which interface should I refer to?
Most of these functions are defined as a member function of the Matrix, but it does not specify how the member function interface of the Matrix should be defined. This has encountered some problems in interface readability and interface testing (Making it easier to write unittest for comparing gpu and cpu version of a function #385).
To import a third-party library requires a piece of code to wrap the interface provided by the third-party library to facilitate calls in Paddle. So, what needs to be considered is how to simplify the writing of this wrapper code.
A unified function interface description
Paddle has many computationally related code(ISSUE #997), by analyzing these interfaces, we can understand that what issues needs to solve.
real
at compile time.NO_VALUE
orFLOAT_VALUE
;If we have designed an interface to solve these problems, we can reorganize the code(#892 (comment)) of the interface listed in #997.
The text was updated successfully, but these errors were encountered: