-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add padding layer. #979
Add padding layer. #979
Conversation
Here's the code for testing.
The output is listed as follows
|
Adding unit tests would be better. In that way, future changes can be tested. travis-ci jobs failed. Running clang-format with |
@beru @edgarriba Maybe we should enlarge the threshold, 1e-4 is too small? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the PR looks good, however I would like to see more specific names since your implementation is ZeroPadding2d (in pytorch terminology). We can leave it prepared to handle more padding modes by now
UPDATE: https://pytorch.org/docs/stable/nn.html?highlight=padding#zeropad2d
@edgarriba |
@edgarriba @beru |
Actually, #978 also failed on train2 sometimes. |
@edgarriba |
@edgarriba Here's the error log:
|
#986 also failed. |
@hzxie It looks like recent googletest change is the cause. polybar/polybar#1393 I'm wondering if adding
before Line 14 in ceb8b9f
might solve the problem... |
Talking about unit tests. https://github.com/catchorg/Catch2 is also famous test framework. But I guess rewriting unit tests isn't trivial. |
@beru Catch2 looks pretty good and fits perfect with our header-only policy. If anyone wants to take this task, why not. UPDATE: I suggest discussing it first in |
Rewriting unit testing cases is time-consuming. |
@hzxie agree. This PR #968 tries to fix this, take a look at it. Besides, what makes sense now is to rethink about how to setup a proper infrastructure with travis since lately things became overcomplicated with the more third-party stuff we added. At some point we should introduce docker based testing. We internally had this discussion. We should probably start a proper discussion about it. Let me open a thread since there are more some folks interested in this as well @Ravenwater @chrberger UPDATE: There's already an open thread where we shared very few opinions. |
@hzxie I added a wiki page about how to update AUTHORS file. https://github.com/tiny-dnn/tiny-dnn/wiki/How-to-update-AUTHORS-file Please check it out. |
Actually, it's OK with VC++ (Windows platform) builds but I'm not sure why. |
I want to remove CI job problems, so made a pull request. #987
Maybe next time. |
@hzxie why don't we just reuse this script ? |
I think it's fine. In that way, we can show homage to nodejs team. It's a short script file, so adding the file to |
The script appends comments after authors list but those comments were manually removed. https://github.com/tiny-dnn/tiny-dnn/commits/master/AUTHORS It would be easier to understand if you run the script. |
@beru reuse or adapt |
I see. So adding the file to scripts folder seems fine. |
Ignore files generated by CMake.
Fix some bugs in .gitignore.
@beru @edgarriba BTW, the new test script is not clear as before. |
@hzxie LGTM. However, you should split the commit one for padding and the other to update the authors script. |
@edgarriba Please consider merging this PR. |
@edgarriba @beru |
.gitignore
Outdated
@@ -219,4 +219,4 @@ docs/_build | |||
*.pb.h | |||
CMakeFiles* | |||
build* | |||
DartConfiguration.tcl | |||
DartConfiguration.tcl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No new line at end of file
AUTHORS
Outdated
@@ -72,4 +72,4 @@ Karan Desai <karandesai_96@live.com> | |||
MeiHui FAN <mhfan@ustc.edu> | |||
Rui Huang <vowstar@users.noreply.github.com> | |||
Siddhartha Rao Kamalakara <srk97c@gmail.com> | |||
Jaakko Rantala <jaakko.rantala@gmail.com> | |||
Jaakko Rantala <jaakko.rantala@gmail.com> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No new line at end of file
tiny_dnn/tiny_dnn.h
Outdated
@@ -102,6 +103,8 @@ using fc = tiny_dnn::fully_connected_layer; | |||
|
|||
using dense = tiny_dnn::fully_connected_layer; | |||
|
|||
using zreo_pad = tiny_dnn::zero_pad_layer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've found a typo. zreo_pad
should be zero_pad
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OMG.
Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
I created padding layer because TinyDNN hasn't support add padding in convolutional layers.
The padding layer is similar to
tf.pad
in Tensorflow.