Skip to content
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

Two Successive Linear Layer is same with one linear layer. #5580

Closed
1 task done
developer0hye opened this issue Nov 9, 2021 · 6 comments
Closed
1 task done

Two Successive Linear Layer is same with one linear layer. #5580

developer0hye opened this issue Nov 9, 2021 · 6 comments
Labels
question Further information is requested Stale

Comments

@developer0hye
Copy link
Contributor

developer0hye commented Nov 9, 2021

Search before asking

Question

Hi!, @glenn-jocher and @dingyiwei !

I am trying to improve the performance of object detection model with transformer layer. And I found that @dingyiwei already experimented it on this project.

I have one question about your method.

x = self.fc2(self.fc1(x)) + x

Why do you design the transformer layer with two successive linear layer?

Two Successive Linear Layer is same with one linear layer theorectically.

Additional

No response

@developer0hye developer0hye added the question Further information is requested label Nov 9, 2021
@glenn-jocher
Copy link
Member

@developer0hye that's a good question, but I can't answer that myself since @dingyiwei is the C3TR author in PR# #2333.

I know 2 convolution2d layers in series are reducible to 1 if it were not for the activation layer in between, does the same hold true for fully connected layers with no activation in between?

@developer0hye
Copy link
Contributor Author

developer0hye commented Nov 9, 2021

@glenn-jocher

If the kernel size of conv2d layer is one, your statement is true!

@dingyiwei
Copy link
Contributor

Hi @developer0hye , thanks to point out this issue! It should be an activation between the two successive linear layer. I'll run experiments on that and post results here.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 10, 2021

👋 Hello, this issue has been automatically marked as stale because it has not had recent activity. Please note it will be closed if no further activity occurs.

Access additional YOLOv5 🚀 resources:

Access additional Ultralytics ⚡ resources:

Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!

Thank you for your contributions to YOLOv5 🚀 and Vision AI ⭐!

@mx2013713828
Copy link

Hi @developer0hye , thanks to point out this issue! It should be an activation between the two successive linear layer. I'll run experiments on that and post results here.

I'm waiting your experiments.

@dingyiwei
Copy link
Contributor

In this comment I mentioned why I removed the activation function.
I have to find a new computing platform and rerun my experiments because I left the lab recently before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested Stale
Projects
None yet
Development

No branches or pull requests

4 participants