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

add option to nn.Linear to have no bias #583

Merged
merged 1 commit into from
Jan 26, 2016
Merged

add option to nn.Linear to have no bias #583

merged 1 commit into from
Jan 26, 2016

Conversation

soumith
Copy link
Member

@soumith soumith commented Jan 25, 2016

Implemented by @lvdmaaten

self.output:resize(self.bias:size(1))
self.output:copy(self.bias)
self.output:resize(self.weight:size(1))
if self.bias then self.output:copy(self.bias) else self.output:fill(0) end
Copy link
Contributor

Choose a reason for hiding this comment

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

Just wondering, isn't zero() faster than fill(0) for contiguous tensors in GPU ?

Copy link
Member Author

Choose a reason for hiding this comment

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

you're right. will fix.

soumith added a commit that referenced this pull request Jan 26, 2016
add option to nn.Linear to have no bias
@soumith soumith merged commit 6bd733c into master Jan 26, 2016
@soumith soumith deleted the nobiaslinear branch January 26, 2016 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants