Skip to content

Commit

Permalink
Merge pull request #50 from mewilhel/master
Browse files Browse the repository at this point in the history
Add NNLib dependency, swish1 to swish name, bump SpecialFunctions dep
  • Loading branch information
mewilhel committed Dec 2, 2021
2 parents 8d94969 + 0092457 commit 9a39ac8
Show file tree
Hide file tree
Showing 21 changed files with 1,102 additions and 335 deletions.
20 changes: 4 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,13 @@ jobs:
matrix:

include:
- version: '1'
os: ubuntu-latest
arch: x64
- version: '1.0'
os: ubuntu-latest
arch: x64
- version: '1.1'
os: ubuntu-latest
arch: x64
- version: '1.2'
os: ubuntu-latest
arch: x64
- version: '1.3'
- version: '1.6'
os: ubuntu-latest
arch: x64
- version: '1.4'
os: ubuntu-latest
- version: '1.6'
os: windows-latest
arch: x64
- version: '1.5'
- version: '1'
os: ubuntu-latest
arch: x64
- version: '1'
Expand Down
20 changes: 11 additions & 9 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "McCormick"
uuid = "53c679d3-6890-5091-8386-c291e8c8aaa1"
authors = ["Matthew Wilhelm <matthew.wilhelm@uconn.edu>"]
version = "0.11.0"
version = "0.12"

[deps]
DiffRules = "b552c78f-8df3-52c6-915a-8e097449b14b"
Expand All @@ -11,21 +11,23 @@ IntervalArithmetic = "d1acc4aa-44c8-5952-acd4-ba5d80a2a253"
IntervalRootFinding = "d2bf35a9-74e0-55ec-b149-d360ff49b807"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
NaNMath = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3"
NNlib = "872c559c-99b0-510c-b3b7-b6c96a88d5cd"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"

[compat]
DiffRules = "0.0.5, 0.0.6, 0.0.7, 0.0.8, 0.0.9, 0.0.10, 0.1.0, ~1.0"
DiffRules = "1.5"
DocStringExtensions = "~0.8"
ForwardDiff = "~0.5.0, ~0.6, ~0.7, ~0.8, ~0.9, ~0.10"
IntervalArithmetic = "~0.14, ~0.15, ~0.16, ~0.17"
ForwardDiff = "~0.10"
IntervalArithmetic = "~0.20"
IntervalRootFinding = "~0.5"
NaNMath = "0.3.3"
Reexport = "~0.2"
StaticArrays = "~0.8, ~0.9, ~0.10, ~0.11, ~0.12"
SpecialFunctions = "~0.8, ~0.9, ~0.10"
julia = "~1"
NaNMath = "0.3.5"
NNlib = "~0.7"
Reexport = "~0.2, ~1"
StaticArrays = "~1.2"
SpecialFunctions = "~1, ~2"
julia = "~1.6, ~1.7"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand Down
3 changes: 1 addition & 2 deletions benchmark/check_allocations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ for T in (NS, Diff, MV)
!iszero(allocs(@benchmark ($op)($a) samples = 1)) && println("0 in X $op Allocates")
a = MC{5,T}(-0.5,(Interval{Float64}(-0.9,-0.1)),2)
!iszero(allocs(@benchmark ($op)($a) samples = 1)) && println("Negative $op Allocates")
end
end
for op in (min, max, *, -, +, /)
x = MC{5,T}(0.4,(Interval{Float64}(0.1,0.9)),2)
y = MC{5,T}(0.5,(Interval{Float64}(0.3,0.9)),2)
Expand All @@ -52,7 +52,6 @@ for T in (NS, Diff, MV)
a = MC{5,T}(-0.5,Interval{Float64}(-0.9,-0.1),2); !iszero(allocs(@benchmark $a^(-2) samples = 1)) && println("a^-2 Neg Allocates")
a = MC{5,T}(0.4,Interval{Float64}(0.1,0.9),2); !iszero(allocs(@benchmark $a^(-3) samples = 1)) && println("a^-3 Pos Allocates")
a = MC{5,T}(-0.5,Interval{Float64}(-0.9,-0.1),2); !iszero(allocs(@benchmark $a^(-3) samples = 1)) && println("a^-3 Neg Allocates")
end
end

println("Allocation Check Complete!")
15 changes: 7 additions & 8 deletions src/McCormick.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ import Base: +, -, *, /, convert, in, isempty, one, zero, real, eps, max, min,
cos, tan, min, max, sec, csc, cot, ^, step, sign, intersect,
promote_rule, asinh, atanh, tanh, atan, asin, cosh, acos,
sind, cosd, tand, asind, acosd, atand,
secd, cscd, cotd, asecd, acscd, acotd, isone, isnan, empty,
secd, cscd, cotd, asecd, acscd, acotd, isone, isnan, isfinite, empty,
<, <=, ==, fma, cbrt, sinpi, cospi, union

import NNlib: relu, selu, leakyrelu, sigmoid, swish, gelu, elu, softsign, logcosh, softplus

using IntervalArithmetic
using IntervalArithmetic: @round
if isdefined(IntervalArithmetic, :big53)
Expand All @@ -49,12 +51,8 @@ import IntervalArithmetic: dist, mid, pow, +, -, *, /, convert, in, isempty,
secd, cscd, cotd, asecd, acscd, acotd, half_pi,
setrounding, diam, isthin, abs2

if ~(VERSION < v"1.1-")
import SpecialFunctions: erf, erfc, erfinv, erfcinv
export erf, erfinv, erfc, erfcinv, erf_kernel,
erfinv_kernel, erfc_kernel, erfcinv_kernel
end

import SpecialFunctions: erf, erfc, erfinv, erfcinv
export erf, erfinv, erfc, erfcinv, erf_kernel, erfinv_kernel, erfc_kernel, erfcinv_kernel
import Base.MathConstants.golden

# Export forward operators
Expand All @@ -67,7 +65,7 @@ export MC, MCNoGrad, cc, cv, Intv, lo, hi, cc_grad, cv_grad, cnst, +, -, *, /,
sind, cosd, tand, asind, acosd, atand, nan,
sinhd, coshd, tanhd, asinhd, acoshd, atanhd,
secd, cscd, cotd, asecd, acscd, acotd,
secdh, cschd, cothd, asechd, acschd, acothd, isone, isnan, interval_MC,
secdh, cschd, cothd, asechd, acschd, acothd, isone, isfinite, isnan, interval_MC,
relu, param_relu, leaky_relu, maxsig, maxtanh, softplus, pentanh,
sigmoid, bisigmoid, softsign, gelu, elu, selu, swish1,
positive, negative, lower_bnd, upper_bnd, bnd, xlogx,
Expand Down Expand Up @@ -617,5 +615,6 @@ using Reexport
@reexport using IntervalArithmetic
@reexport using StaticArrays
@reexport using SpecialFunctions
@reexport using NNlib

end

2 comments on commit 9a39ac8

@mewilhel
Copy link
Member Author

Choose a reason for hiding this comment

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

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/49765

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.12.0 -m "<description of version>" 9a39ac833217177a237bc31889273e665271f78a
git push origin v0.12.0

Please sign in to comment.