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

Doc corrections and unicode(theta) #184

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

AdarshKumar712
Copy link
Contributor

@AdarshKumar712 AdarshKumar712 commented Mar 7, 2020

I have made some minor doc corrections and replaced alpha, beta, theta with their unicode chars.
I have also updated the leakyrelu activation function to address #176 , and replaced x / one(x) with x / 1 as x / 1 works faster. Please have a look at these changes.

@codecov-io
Copy link

codecov-io commented Mar 7, 2020

Codecov Report

Merging #184 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #184   +/-   ##
=======================================
  Coverage   71.11%   71.11%           
=======================================
  Files          26       26           
  Lines         945      945           
=======================================
  Hits          672      672           
  Misses        273      273
Impacted Files Coverage Δ
src/conv.jl 87.5% <ø> (ø) ⬆️
src/gemm.jl 100% <ø> (ø) ⬆️
src/impl/conv_im2col.jl 98.21% <100%> (ø) ⬆️
src/impl/depthwiseconv_direct.jl 96.72% <100%> (ø) ⬆️
src/activation.jl 93.75% <100%> (ø) ⬆️
src/impl/conv_direct.jl 87.09% <100%> (ø) ⬆️
src/impl/depthwiseconv_im2col.jl 100% <100%> (ø) ⬆️
src/impl/pooling_direct.jl 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ac5101b...1cfbf81. Read the comment docs.

@@ -11,13 +11,13 @@ end
end

"""
conv_im2col!(y, x, w, cdims, col=similar(x); alpha=1, beta=0)
conv_im2col!(y, x, w, cdims, col=similar(x); α=1, β=0)
Copy link
Member

Choose a reason for hiding this comment

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

is this exported or used in flux? we should not break the interface

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I searched for this in the flux source files, but didn't found any function where this or other functions changed here, use alpha or beta parameters. However, flux re-export NNlib in its main file. I hope there shouldn't be any problem with Flux related interface.

@AdarshKumar712 AdarshKumar712 changed the title Doc corrections and unicode(alpha,beta,theta) Doc corrections and unicode(theta) Apr 6, 2020
@AdarshKumar712
Copy link
Contributor Author

@CarloLucibello can you please review these changes? I have removed the Unicode for alpha and beta as they may break the interface for some of the dependent packages, as you pointed out earlier.
Thanks!


Threshold Gated Rectified Linear.
See [ThresholdRelu](https://arxiv.org/pdf/1402.3337.pdf)
"""
trelu(x::Real,theta = one(x)) = ifelse(x> theta, x, zero(x))
trelu(x::Real,θ = one(x)) = ifelse(x> θ, x, zero(x))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
trelu(x::Real,θ = one(x)) = ifelse(x> θ, x, zero(x))
trelu(x::Real, θ=one(x)) = ifelse(x> θ, x, zero(x))

"""
logcosh(x)
logcosh(x) = x + softplus(-2x) - log(2)
Copy link
Member

Choose a reason for hiding this comment

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

the mathematical definition better down in the docstring

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So this should be changed for all the existing functions? As in all the rest functions, mathematical definition is written beside the function.

@AdarshKumar712
Copy link
Contributor Author

@CarloLucibello I have moved the mathematical definition to docstrings, for all the functions to maintain the uniformity. Please review these changes.

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.

3 participants