Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ADerrors.jl
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alberto Ramos
ADerrors.jl
Commits
ae7be701
Commit
ae7be701
authored
Jul 07, 2020
by
Alberto Ramos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed hyperd from src
parent
c06609c5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
110 deletions
+0
-110
src/ADerrors.jl
src/ADerrors.jl
+0
-3
src/ADerrorsHyperd.jl
src/ADerrorsHyperd.jl
+0
-99
src/ADerrorsTypes.jl
src/ADerrorsTypes.jl
+0
-8
No files found.
src/ADerrors.jl
View file @
ae7be701
...
...
@@ -17,9 +17,6 @@ import ForwardDiff: HessianConfig, GradientConfig, Chunk, hessian!
# Include data types
include
(
"ADerrorsTypes.jl"
)
# hyperd for hessian
include
(
"ADerrorsHyperd.jl"
)
# Include computation of autoCF
include
(
"ADerrorsCF.jl"
)
...
...
src/ADerrorsHyperd.jl
deleted
100644 → 0
View file @
c06609c5
###
### "THE BEER-WARE LICENSE":
### Alberto Ramos wrote this file. As long as you retain this
### notice you can do whatever you want with this stuff. If we meet some
### day, and you think this stuff is worth it, you can buy me a beer in
### return. <alberto.ramos@cern.ch>
###
### file: ADerrorsHyperd.jl
### created: Mon Jul 6 19:58:53 2020
###
for
op
in
(
:
sin
,
:
cos
,
:
tan
,
:
log
,
:
exp
,
:
sqrt
,
:
sind
,
:
cosd
,
:
tand
,
:
sinpi
,
:
cospi
,
:
sinh
,
:
cosh
,
:
tanh
,
:
asin
,
:
acos
,
:
atan
,
:
asind
,
:
acosd
,
:
atand
,
:
sec
,
:
csc
,
:
cot
,
:
secd
,
:
cscd
,
:
cotd
,
:
asec
,
:
acsc
,
:
acot
,
:
asecd
,
:
acscd
,
:
acotd
,
:
sech
,
:
csch
,
:
coth
,
:
asinh
,
:
acosh
,
:
atanh
,
:
asech
,
:
acsch
,
:
acoth
,
:
sinc
,
:
cosc
,
:
deg2rad
,
:
rad2deg
,
:
log2
,
:
log10
,
:
log1p
,
:
exp2
,
:
exp10
,
:
expm1
,
:-
)
@eval
function
Base
.$
op
(
h
::
hyperd
)
fvec
(
x
::
Vector
)
=
Base
.$
op
(
x
[
1
])
v
=
Base
.$
op
(
h
.
v
)
d1
=
ForwardDiff
.
derivative
(
$
op
,
h
.
v
)
v2
=
ForwardDiff
.
hessian
(
fvec
,
[
h
.
v
])
return
hyperd
(
v
,
d1
*
h
.
d1
,
d1
*
h
.
d2
,
v2
[
1
]
*
h
.
d1
*
h
.
d2
+
d1
*
h
.
dd
)
end
end
Base
.:+
(
h1
::
hyperd
,
h2
::
hyperd
)
=
hyperd
(
h1
.
v
+
h2
.
v
,
h1
.
d1
+
h2
.
d1
,
h1
.
d2
+
h2
.
d2
,
h1
.
dd
+
h2
.
dd
)
Base
.:+
(
h1
::
hyperd
,
h2
::
Number
)
=
hyperd
(
h1
.
v
+
h2
,
h1
.
d1
,
h1
.
d2
,
h1
.
dd
)
Base
.:+
(
h1
::
Number
,
h2
::
hyperd
)
=
hyperd
(
h1
+
h2
.
v
,
h2
.
d1
,
h2
.
d2
,
h2
.
dd
)
Base
.:-
(
h1
::
hyperd
,
h2
::
hyperd
)
=
hyperd
(
h1
.
v
-
h2
.
v
,
h1
.
d1
-
h2
.
d1
,
h1
.
d2
-
h2
.
d2
,
h1
.
dd
-
h2
.
dd
)
Base
.:-
(
h1
::
hyperd
,
h2
::
Number
)
=
h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d1
*
h1
.
v
/
h2
.
v
^
2
,
-
h2
.
d2
*
h1
.
v
/
h2
.
v
^
2
,
h1
*
(
2.0
*
h2
.
d1
*
h2
.
d2
/
h2
.
v
-
h2
.
dd
)
/
h2
.
v
^
2
)
Base
.:^
(
h1
::
hyperd
,
h2
::
hyperd
)
=
exp
(
h2
*
log
(
h1
))
Base
.:^
(
h1
::
hyperd
,
h2
::
Number
)
=
exp
(
h2
*
log
(
h1
))
function
Base
.:^
(
h1
::
hyperd
,
n
::
Integer
)
v
=
h1
.
v
^
n
if
(
n
==
0
)
d1
=
0.0
dd
=
0.0
elseif
(
n
==
1
)
d1
=
1.0
dd
=
0.0
else
d1
=
n
*
h1
.
v
^
(
n
-
1
)
dd
=
n
*
(
n
-
1
)
*
h1
.
v
^
(
n
-
2
)
end
return
hyperd
(
v
,
d1
*
h1
.
d1
,
d1
*
h1
.
d2
,
dd
*
h1
.
d1
*
h1
.
d2
+
d1
*
h1
.
dd
)
end
Base
.:^
(
h1
::
Number
,
h2
::
hyperd
)
=
exp
(
h2
*
log
(
h1
))
# Missing atan, hypot
Base
.
zero
(
::
Type
{
hyperd
})
=
hyperd
(
0.0
,
0.0
,
0.0
,
0.0
)
Base
.
one
(
::
Type
{
hyperd
})
=
hyperd
(
1.0
,
0.0
,
0.0
,
0.0
)
Base
.
length
(
x
::
hyperd
)
=
1
Base
.
iterate
(
x
::
hyperd
)
=
(
x
,
nothing
)
Base
.
iterate
(
x
::
hyperd
,
::
Nothing
)
=
nothing
function
hyperd_hessian
!
(
hess
::
Array
{
Float64
,
2
},
f
::
Function
,
x
::
Vector
{
Float64
})
n
=
length
(
x
)
h
=
Vector
{
hyperd
}(
undef
,
n
)
for
i
in
1
:
n
h
[
i
]
=
hyperd
(
x
[
i
],
0.0
,
0.0
,
0.0
)
end
for
i
in
1
:
n
h
[
i
]
.
d1
=
1.0
for
j
in
i
:
n
h
[
j
]
.
d2
=
1.0
res
=
f
(
h
)
hess
[
i
,
j
]
=
res
.
dd
if
(
j
>
i
)
hess
[
j
,
i
]
=
hess
[
i
,
j
]
end
h
[
j
]
.
d2
=
0.0
end
h
[
i
]
.
d1
=
0.0
end
return
nothing
end
src/ADerrorsTypes.jl
View file @
ae7be701
...
...
@@ -9,14 +9,6 @@
### created: Wed Jun 17 13:00:32 2020
###
mutable struct
hyperd
v
::
Float64
d1
::
Float64
d2
::
Float64
dd
::
Float64
end
mutable struct
cfdata
var
::
Float64
taui
::
Float64
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment