-
Notifications
You must be signed in to change notification settings - Fork 18.7k
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
LogLayer #2090
LogLayer #2090
Conversation
@pannous I do think |
@@ -33,6 +33,7 @@ extern "C" { | |||
|
|||
DEFINE_VSL_UNARY_FUNC(Sqr, y[i] = a[i] * a[i]); | |||
DEFINE_VSL_UNARY_FUNC(Exp, y[i] = exp(a[i])); | |||
DEFINE_VSL_UNARY_FUNC(Ln, y[i] = log(a[i])); |
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 kinda prefer the name log
here, sticking with the name of the elementwise call, but either one is okay...
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.
not my choice -- the MKL function is vsLn
/vdLn
.
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.
Oh. :(
This looks good to me as a counterpart to As a more general issue affecting both of these, however, I wonder if this is the best way to resolve the tension between granularity and functionality. As far as I can tell, these layers could just implement simple |
@longjon yeah, I put the shift/scale fields in to match the existing |
Looks good to me.
This is fine. It could make for a nice warm-up PR in the future. @jeffdonahue rebase and merge away. |
Thanks for the review @shelhamer and @longjon! |
This adds
LogLayer
, aNeuronLayer
, which by default takes the natural log of its inputs. It's designed analogously toExpLayer
andPowerLayer
. (In general computeslog_{\gamma}(\alpha x + \beta)
withlog_param { base: \gamma scale: \alpha shift: \beta }
.)