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

Implement numOutputs for minimum #150

Open
nathantalewis opened this issue Aug 24, 2017 · 3 comments
Open

Implement numOutputs for minimum #150

nathantalewis opened this issue Aug 24, 2017 · 3 comments

Comments

@nathantalewis
Copy link
Contributor

This seems very similar to #129.

The code in question:

let y = (TF.minimum 0 (TF.expm1 x)) `TF.add` (TF.relu x)

The error message: numOuputs not implemented for "Minimum"

I'm using commit 79d8d7e.

Alternatively, if there is an existing implementation of elu that I could use, how would I use it?

@fkm3
Copy link
Contributor

fkm3 commented Aug 24, 2017

Yeah, it is the same general problem, someone needs to add the gradient implementation for minimum. You will also hit the same issue for expm1 I'd guess.

There is already an implementation for maximum. The minimum version should be exactly the same, but instead of greaterEqual, it should use lessEqual here https://github.com/tensorflow/haskell/blob/master/tensorflow-ops/src/TensorFlow/Gradient.hs#L540

@fkm3
Copy link
Contributor

fkm3 commented Aug 24, 2017

There is a builtin implementation of elu https://tensorflow.github.io/haskell/haddock/tensorflow-core-ops-0.1.0.0/TensorFlow-GenOps-Core.html#v:elu and its gradient function https://tensorflow.github.io/haskell/haddock/tensorflow-core-ops-0.1.0.0/TensorFlow-GenOps-Core.html#v:eluGrad, so that might be the easier route. (though you'd still need to plug that gradient function into the Gradient.hs framework)

@nathantalewis
Copy link
Contributor Author

I must have missed the built-in version. Thanks for pointing it out. If I can get the gradient function plugged in I'll make a PR for it.

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

No branches or pull requests

2 participants