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

Softmax op #440

Merged
merged 14 commits into from
Oct 14, 2020
Merged

Softmax op #440

merged 14 commits into from
Oct 14, 2020

Conversation

dcu
Copy link
Collaborator

@dcu dcu commented Oct 10, 2020

No description provided.

op_softmax.go Outdated
sm.Reshape(inputTensor.Shape().TotalSize(), 1)

smT := sm.Clone().(tensor.Tensor)
smT.Transpose()
Copy link
Member

Choose a reason for hiding this comment

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

you can use smT.T(), which does no work, rather than Transpose which does a lot of work

op_softmax.go Outdated
smT := sm.Clone().(tensor.Tensor)
smT.Transpose()

smDot, err := tensor.Dot(sm, smT)
Copy link
Member

Choose a reason for hiding this comment

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

Use MatMul. tensor.Dot is a bad habit

dcu and others added 10 commits October 11, 2020 21:59
And handle the errors properly
And add debugging statements
Co-authored-by: David Cuadrado <73729+dcu@users.noreply.github.com>
Updated softmax test to also check for values

Co-authored-by: David Cuadrado <73729+dcu@users.noreply.github.com>
Co-authored-by: David Cuadrado <73729+dcu@users.noreply.github.com>
@dcu dcu marked this pull request as ready for review October 13, 2020 12:20
@chewxy
Copy link
Member

chewxy commented Oct 14, 2020

Phew. This LGTM. Once it passes tests, you can merge. Most excellent work @dcu

@chewxy chewxy merged commit b44c85d into gorgonia:master Oct 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants